https://casaguides.nrao.edu/api.php?action=feedcontributions&user=Knyland&feedformat=atomCASA Guides - User contributions [en]2024-03-29T04:37:00ZUser contributionsMediaWiki 1.38.6https://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4&diff=16113EVLA Wide-Band Wide-Field Imaging: G55.7 3.42014-05-20T20:51:24Z<p>Knyland: /* Delay and Bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.2. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192 this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each sub-band and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'RR,LL')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4&diff=16112EVLA Wide-Band Wide-Field Imaging: G55.7 3.42014-05-20T03:27:41Z<p>Knyland: /* Delay and Bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.2. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192 this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each sub-band and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'RR,LL')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4&diff=16111EVLA Wide-Band Wide-Field Imaging: G55.7 3.42014-05-20T03:25:10Z<p>Knyland: /* Delay and Bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.2. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192 this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'RR,LL')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_high_frequency_Spectral_Line_tutorial_-_IRC%2B10216&diff=15948EVLA high frequency Spectral Line tutorial - IRC+102162014-04-03T04:52:44Z<p>Knyland: /* Velocity Systems and Doppler corrections */</p>
<hr />
<div>[[Category:EVLA]][[Category:Calibration]][[Category:Spectral Line]]<br />
<br />
'''Please use CASA 4.2 for this tutorial'''<br />
<br />
<br />
<br />
== Overview ==<br />
[[Image:irc10216_dust.jpg|thumb|VLT V-band image of IRC+10216 showing dust rings out to a radius of 90" by Le&atilde;o et al. (2006, A&A, 455, 187).]]<br />
<br />
This tutorial describes the data reduction for two spectral lines observed toward the AGB star IRC+10216. <br />
In this Jansky VLA "OSRO1" mode observation one subband was observed in each of two basebands, with the subbands centered on the HC3N and SiS lines near 36 GHz. The raw data were loaded into CASA with {{importevla}}, where zero and shadowed data were flagged (note that this is done by the [https://archive.nrao.edu/archive/advquery.jsp NRAO Data Archive]). Then the data were {{split}}, so we could average from the native 1-second integrations to 10 seconds, select only antennas with Ka-band receivers, and select only spectral windows (called spw in CASA) with Ka-band data. This produces a significantly smaller dataset for processing.<br />
<br />
IRC+10216 (CW Leo) is the brightest star in the sky at 5 microns but only 16th magnitude visually. It was discovered during the first survey of the infrared sky, carried out by Bob Leighton and Gerry Neugebauer in 1965. An Asymptotic Giant Branch star, it is a Mira-type variable going through prodigious episodic mass loss. The dust condensed from the atmosphere during the mass loss is responsible for the millimeter emission; the continuum emission seen at radio wavelengths probes the actual stellar photosphere. Molecules form along with the dust, and a steady state chemistry occurs in the dense inner regions (Tsuji 1973 A&A 23, 411). As the density of material drops, the chemistry freezes. But the molecules continue their long coast outward into the Galaxy, and as the shell thins ultraviolet light from the ambient galactic radiation field penetrates and initiates a new chemistry in the gas.<br />
<br />
SiS, a simple molecule created in the dense inner envelope chemistry is photodissociated as it coasts out into the shell. The result is the centrally condensed emission we see in the present observations. Interestingly, in the next lower transition at 18 GHz, the line shape is much different from what we see here. At the extreme velocities in the profile, very bright narrow emission is seen which has been interpreted as maser emission. The interested student can find VLA observations of this line in the archive.<br />
<br />
HC3N, a much more complex species, is created by the photochemistry which becomes active as atoms and pieces of molecules destroyed by ultraviolet radiation undergo the next phase of chemistry in the shell. HC3N has many vibrational modes which may be excited in addition to its rotational modes. Owing to this, it can re-radiate energy absorbed from ultraviolet radiation more effectively than some molecules with a single bond. Eventually it too is destroyed however, but during its brief existence its rise to abundance in the envelope results in a ring of emission, which is what is observed in this image made with the Jansky VLA. A recent model by Cordiner & Millar (2009, ApJ, 697, 68) describes a new chemical model for the shell, which also takes into account the variation of mass loss by the star. They show that in addition to purely chemical effects, local gas and dust density peaks play a role in shaping the observed emission.<br />
<br />
==Getting the data==<br />
<br />
The post-split averaged data can be downloaded from [http://casa.nrao.edu/Data/EVLA/IRC10216/day2_TDEM0003_10s_norx.tar.gz http://casa.nrao.edu/Data/EVLA/IRC10216/day2_TDEM0003_10s_norx.tar.gz] (data size: 1.1GB)<br />
<br />
Once the download is complete, unzip and unpack the file:<br />
<br />
<source lang='bash'><br />
# in a terminal, outside of CASA:<br />
tar -xzvf day2_TDEM0003_10s_norx.tar.gz<br />
</source><br />
<br />
== How to Use This casaguide==<br />
<br />
[[Image:clean.png|thumb|Inputs from one of the clean commands from this tutorial]]<br />
There are a number of possible ways to run CASA. Many aspects are described in [[Getting_Started_in_CASA]]. You should review this page if you are new to CASA. In brief you can run CASA interactively by looking at the inputs to tasks with '''inp taskname''' (example: inp clean), setting the parameters one by one (example: selectdata=T) as you desire and then run '''go'''. After setting parameters one by one in a task and then looking at the inputs again, you will notice that the parameters that have been set to something other than their defaults are blue. If you have mistyped any parameters, they will be red and must be fixed for the task to run correctly. You can get more detailed help on any task by typing '''help taskname''' (example: help clean). Once a task is run you can get the same parameters back by running '''tget taskname''' (example: tget clean); subsequent runs will overwrite the previous tget file. <br />
<br />
The second way to run CASA is to provide task function calls. This tutorial is made up of such calls, which were developed by looking at the inputs for each task and deciding what needed to be changed from default values. For task function calls, '''only parameters that you want to be different from their defaults need to be set'''. A series of task function calls can be combined together into a script, and run with '''execfile('scriptname.py')'''. It is possible to extract a script containing all the CASA task function calls in this and other casaguides using the method described at the [[Extracting_scripts_from_these_tutorials]] page.<br />
<br />
If you are a relative novice or just new to CASA it is strongly recommended to work through this tutorial by cutting and pasting the task function calls provided below after you have read all the associated explanations. Work at your own pace, look at the inputs to the tasks to see what other options exist, and read the help files. Later, when you are more comfortable, you might try to extract the script, modify it for your purposes, and begin to reduce other data.<br />
<br />
<br />
==Initial Inspection and Flagging==<br />
<br />
=== Observing Logs ===<br />
<br />
For all VLA observations, the operators keep an observing log. You can look at<br />
the observing logs at the observing log [http://www.vla.nrao.edu/cgi-bin/oplogs.cgi website] by entering a date range covering only 26 Apr 2010, then selecting "TDEM0003". Pertinent information from this observation is repeated below:<br />
<br />
<pre style="background-color: #E0FFFF;"><br />
INFORMATION FROM OBSERVING LOG:<br />
Date of the observation: 26-April-2010<br />
There are no Ka-band receivers on ea11, ea13, ea14, ea16, ea17, ea18, ea26 <br />
Antenna ea06 is out of the array<br />
Antenna 15 has a focus timeout<br />
Antennas ea10, ea12, ea22 do not have good baseline positions<br />
</pre><br />
<br />
All of that information we should keep in mind during the calibration. E.g. if the mentioned list of unavailable receivers do appear in the data, the data is just noise and should be flagged. For the The dataset that you have downloaded the antennas have already been removed. Also keep an eye on other messages such as loss of data, or subreflector problems, or any other such issues. If they were not captured in the online flagging, they should be carefully looked at, treated appropriately during calibration or flagged. <br />
<br />
To start with, we will have a look at the content of the raw data. {{listobs}} provides almost all relevant observational parameters such as correlator setup (frequencies, bandwidths, channel number and widths, polarization products), sources, scans, scan intents, and antenna locations:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs(vis='day2_TDEM0003_10s_norx')<br />
</source><br />
<br />
Below we have cut and pasted the most relevant output from the logger.<br />
<br />
<pre style="background-color: #fffacd;"><br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
2 D J0954+1743 09:54:56.823626 +17.43.31.22243 J2000 2 65326<br />
3 NONE IRC+10216 09:47:57.382000 +13.16.40.65999 J2000 3 208242<br />
5 F J1229+0203 12:29:06.699729 +02.03.08.59820 J2000 5 10836<br />
7 E J1331+3030 13:31:08.287984 +30.30.32.95886 J2000 7 5814<br />
Spectral Windows: (2 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 Subband:0 64 TOPO 36387.229 125.000 8000.0 RR RL LR LL<br />
Sources: 10<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 J1008+0730 0 0.03639232 -0.026 <br />
0 J1008+0730 1 0.03639232 -0.026 <br />
2 J0954+1743 0 0.03639232 -0.026 <br />
2 J0954+1743 1 0.03639232 -0.026 <br />
3 IRC+10216 0 0.03639232 -0.026 <br />
3 IRC+10216 1 0.03639232 -0.026 <br />
5 J1229+0203 0 0.03639232 -0.026 <br />
5 J1229+0203 1 0.03639232 -0.026 <br />
7 J1331+3030 0 0.03639232 -0.026 <br />
7 J1331+3030 1 0.03639232 -0.026 <br />
Antennas: 19:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 -521.9407 -332.7782 -1.1977 -1601710.017000 -5042006.928200 3554602.355600<br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 9.8247 -20.4292 -2.7808 -1601150.059500 -5042000.619800 3554860.729400<br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 506.0591 -251.8666 -3.5832 -1600715.948000 -5042273.187000 3554668.184500<br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 -27.3562 -41.3030 -2.7418 -1601189.030140 -5042000.493300 3554843.425700<br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1158 -272.1493 -1.5032 -1601614.091000 -5042001.655700 3554652.509300<br />
5 ea07 N06 25.0 m -107.37.06.9 +33.54.10.3 -54.0667 263.8720 -4.2292 -1601162.593200 -5041829.000000 3555095.890500<br />
6 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 -30.8810 -1.4664 -2.8597 -1601185.634945 -5041978.156586 3554876.424700<br />
7 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 236.9058 -126.3369 -2.4443 -1600951.588000 -5042125.911000 3554773.012300<br />
8 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8394 -206.0057 -3.2252 -1600801.916000 -5042219.371000 3554706.449900<br />
9 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 -275.8288 -166.7451 -2.0590 -1601447.198000 -5041992.502500 3554739.687600<br />
10 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 -152.8599 -83.8054 -2.4614 -1601315.893000 -5041985.320170 3554808.304600<br />
11 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 -47.8454 192.6015 -3.8723 -1601168.786100 -5041869.054000 3555036.936000<br />
12 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 -23.8638 -81.1510 -2.5851 -1601192.467800 -5042022.856800 3554810.438800<br />
13 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 -42.5986 132.8623 -3.5431 -1601173.953700 -5041902.660400 3554987.536500<br />
14 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 318.0523 -164.1848 -2.6960 -1600880.570000 -5042170.388000 3554741.457400<br />
15 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 -210.0944 -122.3885 -2.2581 -1601377.008000 -5041988.665500 3554776.393400<br />
16 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 -35.6245 53.1806 -3.1345 -1601180.861480 -5041947.453400 3554921.628700<br />
17 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 50.6647 -39.4832 -2.7249 -1601114.365500 -5042023.153700 3554844.945600<br />
18 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9057 433.1889 -5.0602 -1601147.940400 -5041733.837000 3555235.956000<br />
</pre><br />
<br />
In addition to source names, antenna names, etc. CASA indexes each of these parameters starting from 0. To specify, e.g., a source field, one can use the index or the name -- both are accepted. <br />
<br />
Note that the Rest Frequency and Systemic Velocity are wrong in the listobs log by a factor 10^6 and 1000, respectively, given the quoted units (MHz) and (km/s). This was due to a temporary error in the VLA Observing Tool that has subsequently been fixed. Because the sky frequencies are correct, and we set the rest frequency explicitly later in the deconvolution stage, this does not present a problem for the data reduction. <br />
<br />
<pre style="background-color: #E0FFFF;"><br />
Summary of Observing Strategy<br />
Gain Calibrator: J0954+1743, field id=2<br />
Bandpass Calibrator: J1229+0203, field id=5<br />
Flux Calibrator: J1331+3030 (3C286), field id=7<br />
Target: IRC+10216, field id=3<br />
Ka-band spws = 0,1<br />
</pre> <br />
<br />
[[Image:Ant_locations.png|thumb|Antenna locations from running plotants ]]<br />
Look at a graphical plot of the antenna locations and save hardcopy<br />
in case you want it later. This will be useful for picking a reference antenna --<br />
typically a good choice is an antenna close to the center of the array. Unless it <br />
shows problems after inspection of the data, we provisionally choose ea02.<br />
<br />
[[Image:elevationvstime.png|thumb|Elevation as a function of time (after selecting colorize by field).]]<br />
<source lang="python"><br />
# In CASA<br />
plotants(vis='day2_TDEM0003_10s_norx',figfile='ant_locations.png')<br />
</source><br />
<br />
Next, let's look at the elevation as a function of time for all sources. It's not the case for these data, but if the elevation is very low (usually at start or end of track) you may want to flag. Also, how near in elevation your flux calibrator is to your target will impact your ultimate absolute flux calibration accuracy. <br />
<br />
Unfortunately, the target and flux calibrator are not particularly well-matched for this observation, as you can show by plotting the elevation for each source (each sources has a different colors). We will be using data in spectral window 0, channels 4 to 60 for this plot as given by the '''spw = '0:4~60'''' parameter; the general CASA selection syntax is described in the [http://www.aoc.nrao.edu/~sbhatnag/misc/msselection/msselection.html Measurement Selection Syntax Document]:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',<br />
xaxis='time',yaxis='elevation',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60', coloraxis='field')<br />
</source><br />
<br />
Thus we are strongly dependent on the opacity and gaincurve corrections to get the flux scale right for these data. (This is something to keep in mind when planning observations!) We will deal with this after the initial inspection.<br />
<br />
[[Image:plotallfields.png|thumb|Result of plotms]]<br />
[[Image:Zoom1_mark.png|thumb|Zooming in and marking region (hatched box)]]<br />
<br />
Next, let's look at all the source amplitudes as a function of time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60', coloraxis='field')<br />
</source><br />
<br />
Now zoom in on the region very near zero amplitude for sources J0954+1743 and IRC+10216. To zoom, select the <br />
Zoom tool [[File:casaplotms-zoom.png]] in lower left corner of the {{plotms}} GUI, then you can left click to draw a box. <br />
Look for the low values (you may want to zoom a few times to really see the suspect points clearly). Now use the Mark Region [[Image:MarkRegionsButton.png]] and Locate [[File:casaplotms-locate-tool.png]] buttons (located along the bottom of the GUI) to see which antenna is causing problems. The output is be shown in the logger. Since all the "located" baselines include ea12, this is the responsible antenna.<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON PLOTMS:<br />
<br />
* When using the locate button it is important to have only selected a modest number <br />
of points with the mark region tool (see example of marked region in the thumbnail), <br />
otherwise the response will be very slow and possibly hang the tool <br />
(all of the information will be output to your terminal window, not the logger). <br />
<br />
* Throughout the tutorial, when you are done marking/locate use the Clear Regions <br />
tool to get rid of the marked box before plotting other things. <br />
<br />
* After flagdata command flagging, you have to force a complete reload of the cache <br />
to look at the same plot again with the new flags applied. To do this, either check the "force reload" box in the lower left, or do Shift+Plot.<br />
<br />
<br />
</pre> <br />
<br />
Now click the clear region [[File:casaplotms-clear-region.png]] button, and then go back to the zoom button to zoom in further to note exactly what the time range is: 03:41:00~04:10:00.<br />
<br />
Check the other sideband by changing spw to 1:4~60. You will have to<br />
re-zoom. If you have trouble, click on the Mark icon and then back to<br />
zoom. In spw 1, ea07 is bad from the beginning until after next<br />
pointing run: 03:21:40~04:10:00. To see this, compare the amplitudes when antenna is set to 'ea07' and when it is set to one of the other antennas, such as 'ea08'.<br />
<br />
If you set antenna to 'ea12' and zoom in on this initial timerange, you can also see that ea12 is bad during the same time range as for spw 0. You can also see this by entering '!ea07' for antenna, which removes ea07 from the plot (in CASA selection, "!" deselects). <br />
<br />
We can set up a flagging command to get both bad antennas for the<br />
appropriate time and spw:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='day2_TDEM0003_10s_norx',<br />
mode='list',<br />
inpfile=["field='2,3' antenna='ea12' timerange='03:41:00~04:10:00'",<br />
"field='2,3' antenna='ea07' timerange='03:21:40~04:10:00' spw='1'"])<br />
</source><br />
<br />
<br />
{{flagdata}} in mode='list' can take several commands, separated by commas. The data selection will be connected by AND for each string. <br />
<br />
Note that because the chosen timerange is limited to fields 2 and 3, the field parameter is not really<br />
needed but the above is a nice example of the task syntax.<br />
<br />
Now remove the !ea07 from antenna and replot both spw, zooming in to<br />
be sure that all obviously low points are gone. Also zoom in and<br />
check 3C286 (J1229+0203 is already obvious because it is so bright!). <br />
<br />
[[Image:IRC10216_uvdist1.png|thumb|Amplitude vs. uv-distance for IRC+10216, both spw]]<br />
<br />
Let's look more closely at IRC+10216:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0~1:4~60', coloraxis='spw')<br />
</source><br />
<br />
You can see a that there are some noisy high points. But now try:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0~1:4~60', coloraxis='spw')<br />
</source><br />
<br />
Now, we can see that most of the high points on IRC+10216 are due to large scale emission on short baselines, but there is still some noisy stuff -- for a target like this with extended emission it's best to wait until later to decide what to do about it. We will not be able to get adequate calibration for antennas that are truly bad (even if they don't stand out here) so these will be obvious later.<br />
<br />
<br />
== The Observing Log, Antenna Position Corrections, Opacities, Gaincurves, Antenna Efficiencies and other Calibration "Priors"==<br />
<br />
=== Antenna Position Corrections ===<br />
<br />
As mentioned in the observing log above, antennas ea10, ea12, and ea22 do not have good baseline positions. <br />
Antenna ea10 was not in the array, but for the other two antennas we need to check for<br />
any improved baseline positions that were derived after the observations were taken.<br />
In CASA, these corrections can derived by {{gencal}} for the JVLA. The parameter caltype='antpos' will us antenna position offset values and create a calibration table for the delay changes that this correction involves. If the 'antenna' parameter is not specified, {{gencal}} will query the Jansky VLA webpages for the offsets ([http://www.vla.nrao.edu/astro/archive/baselines/ Jansky VLA/VLA Baseline Corrections page]).<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='day2_TDEM0003_10s_norx',caltable='antpos.cal',<br />
caltype='antpos',<br />
antenna='')<br />
</source><br />
<br />
which return the antenna offsets in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea01 : 0.00000 0.00300 0.00000<br />
offsets for antenna ea02 : -0.00080 0.00000 0.00000<br />
offsets for antenna ea03 : -0.00280 0.00000 0.00000<br />
offsets for antenna ea05 : 0.00000 0.00280 0.00000<br />
offsets for antenna ea12 : -0.01000 0.00450 -0.00170<br />
offsets for antenna ea22 : -0.02570 0.00270 -0.01900<br />
offsets for antenna ea23 : -0.00140 0.00000 0.00000<br />
offsets for antenna ea24 : -0.00150 0.00000 0.00000<br />
offsets for antenna ea27 : 0.00000 0.00190 -0.00160<br />
</pre><br />
<br />
<br />
'''Please note: '''if you are reducing VLA data taken before March 1, 2010, you need to set caltype='antposvla'. For the VLA before the conversion to the Jansky VLA, the automated lookup will not work and one has to specify the the antenna positions explicitly.<br />
<br />
<br />
<br />
=== Gaincurves and Antenna Efficiencies ===<br />
<br />
<br />
The gaincurve describes how each antenna behaves as a function of elevation, for each receiver band. Currently only gaincurves for the VLA are available (see [http://www.vla.nrao.edu/astro/guides/vlbivla/current/node18.html] for the incorporated models). This option should not be used with any other telescopes. <br />
<br />
Gaincurves are generated into a separate calibration table using the task {{gencal}} with the ''caltype='gceff'. This option will also include antenna efficiencies in the resulting calibration table:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='day2_TDEM0003_10s_norx',caltable='gaincurve.cal',<br />
caltype='gceff')<br />
</source><br />
<br />
''' Note that this method replaces the ''gaincurve=T'' option in the calibrations tasks in CASA 3.4 and earlier '''<br />
<br />
=== Opacities ===<br />
<br />
The opacity of the observation can be computed from a seasonal model and/or weather station information. We are planning to have a task available for this information. At the moment, the [[CASA_EVLA_Scripts]] page hosts a script and a contributed task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, they will be recomputed for the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> in {{gaincal}}, {{applycal}}, {{bandpass}} etc. <br />
<br />
To start, we want to plot the opacity of the atmosphere at 36 GHz at the time this observation was taken so it can be corrected for in<br />
subsequent calibrations. The task '''plotweather''' takes care of that. The task plots the weather conditions at the time of the observations and calculate the atmospheric opacities basedon these data in combination with a seasonal model that contains long-term statistics at the VLA site. 'seasonal_weight=0.5' gives both equal weights: <br />
<br />
[[Image:day2_TDEM0003_10s_norx.plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
We will be running '''plotweather''' in a way that will assign the opacity list (one entry for each spw in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='day2_TDEM0003_10s_norx', doPlot=T)<br />
</source><br />
<br />
With this input, the task <br />
<br />
* returns the opacity values to the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
plotweather 0 : 36.387 : 0.039<br />
plotweather 1 : 36.305 : 0.039<br />
plotweather wrote weather figure: day2_TDEM0003_10s_norx.plotweather.png<br />
</pre> <br />
<br />
* creates a file '''"day2_TDEM0003_10s_norx.plotweather.png"''' with the elevation of the sun, the wind speed and direction, the temperature, precipitable water vapor (PWV) as functions of time over the observation (view this file with your preferred image viewer like gthumb, xv or Preview), <br />
<br />
* and assigns the myTau variable to the list of opacities per spectral window: <br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau<br />
[0.03922997791177054, 0.038993893363737792]<br />
<br />
</source><br />
<br />
We can now create a calibration table for the opacities via {{gencal}} with the ''calmode='opac' '' parameter, we can either input the opacities directly, or use the myTau variable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='day2_TDEM0003_10s_norx',caltable='opacity.cal',<br />
caltype='opac',<br />
spw='0,1',<br />
parameter=myTau)<br />
</source><br />
''' Note that this method replaces the ''opacity'' option in the calibrations tasks in CASA 3.4 and earlier '''<br />
<br />
<br />
<br />
==Set Up the Model for the Flux Calibrator==<br />
<br />
Next, we set the model for the flux calibrator. Depending on your observing frequency and angular resolution you can do this several ways. In the past, one typically used a point source (constant flux) model for <br />
the flux calibrator, possibly with a uvrange cutoff if necessary. More recently for the VLA, model images for the most common flux calibrators have been made available for use in cases where the sources are somewhat resolved. This is most likely to be true at higher frequencies and at higher resolutions (more extended arrays). <br />
<br />
Currently, CASA contains models for the most common calibrators at the most common frequencies but not yet the new Jansky VLA frequency bands S and Ka. These will be added as soon as they become available. One may check the availability of calibration models in {{setjy}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='day2_TDEM0003_10s_norx',listmodels=T)<br />
</source><br />
<br />
The terminal will now show the available models, e.g. 3C286_C.im, 3C48_K.im etc. ({{setjy}} will search in the working directory for images that may contain models, as well as in a CASA directory where known calibrator models are stored.)<br />
<br />
As mentioned above, the Ka band does not yet have a the full, final model incorporated at this time (even though there is a 3C286_A.im model available in CASA). However, models for Ka-band that are good for D, C, and B configurations are available from the [https://science.nrao.edu/facilities/vla/data-processing/models Jansky VLA calibrator model webpage for the new frequency bands]. <br />
<br />
From this page, please download the file 36.68 GHz CASA image of 3C286, this is the [http://www.aoc.nrao.edu/evlacal/3C286_36.68G.model.tgz direct link.] To do so, you may run <br />
<br />
<source lang='bash'><br />
# in a terminal, outside of CASA:<br />
wget http://www.aoc.nrao.edu/evlacal/3C286_36.68G.model.tgz<br />
tar xzvf 3C286_36.68G.model.tgz<br />
</source><br />
<br />
to create the model '''3C286_36.68G.model''' on disk.<br />
<br />
{{setjy}} scales the total flux in the model image to that appropriate for your individual spectral window frequencies according to the calibrator's flux and reports this number to the logger -- it is a good idea to save this information for your records.<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='day2_TDEM0003_10s_norx',field='7',spw='0~1',<br />
scalebychan=T,<br />
model='3C286_36.68G.model')<br />
</source><br />
<br />
The logger output for each spw is:<br />
<pre style="background-color: #fffacd;"><br />
J1331+3030 (fld ind 7) spw 0 [I=1.7764, Q=0, U=0, V=0] Jy, (Perley-Butler 2010)<br />
Using model image /Users/jott/casa/casatest/casa4.0/irc/3C286_36.68G.model<br />
Scaling spw 0's model image by channel to I = [1.7764, ..., 1.7761] Jy (ch 0) for visibility prediction.<br />
The model image's reference pixel is 1.02784e-06 arcsec from J1331+3030's phase center.<br />
Selected 2907 out of 290218 rows.<br />
J1331+3030 (fld ind 7) spw 1 [I=1.7795, Q=0, U=0, V=0] Jy, (Perley-Butler 2010)<br />
Scaling spw 1's model image by channel to I = [1.77955, ..., 1.77925] Jy (ch 0) for visibility prediction.<br />
</pre><br />
<br />
The absolute fluxes for the frequencies of all channels have now been determined, and one can proceed to the bandpass and complex gain calibrations.<br />
<br />
==Bandpass and Delay==<br />
<br />
Before determining the bandpass solution, we need to inspect phase and amplitude<br />
variations with time and frequency on the bandpass calibrator to<br />
decide how best to proceed. We limit the number of antennas to make<br />
the plot easier to see. We chose ea02 as it seems like a good<br />
candidate for the reference antenna.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='phase',correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02&ea23')<br />
</source><br />
[[Image:Nobandpass_phase.png|thumb|Phase as a function of channel for ea02.]]<br />
<br />
The phase variation is modest ~10 degrees. Now expand to all baselines that include ea02, and add an extra dimension of color:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='phase',correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
[[Image:Nobandpass_phasetime.png|thumb|Phase as a function of time for all baselines with antenna ea02.]]<br />
From this<br />
you can see that the phase variation across the bandpass is<br />
modest. Next check LL, and spw=1, both correlations. Also check<br />
other antennas if you like.<br />
<br />
Now look at the phase as a function of ''time'':<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='time',yaxis='phase',correlation='RR',<br />
avgchannel='64',spw='0:4~60',antenna='ea02&ea23')<br />
</source><br />
<br />
Expand to all antennas with ea02:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='time',yaxis='phase',correlation='RR',<br />
avgchannel='64',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
<br />
You can see that the phase variations are smooth, but do vary<br />
significantly over the 5 minutes of observation -- in most cases by<br />
a few 10s of degrees. Zoom in to see this better if you want.<br />
<br />
The conclusion from this investigation is that you need to correct<br />
the phase variations with time before solving for the bandpass to<br />
prevent decorrelation of the vector averaged bandpass<br />
solution. Since the phase variation as a function of channel is<br />
modest, you can average over several channels to increase the signal<br />
to noise of the phase vs. time solution. If the phase variation as a<br />
function of channel is larger you may need to use only a few<br />
channels to prevent introducing delay-based closure errors as can happen from averaging over<br />
non-bandpass corrected channels with large phase variations.<br />
<br />
<br />
<br />
Let's take care of the delay calibration first. The delay is the slope of phase across frequency. Form the plot we saw that it was rather modest and the bandpass calibration will certainly take care of it. Nevertheless, it might be good to derive a delay calibration first and the calculate the bandpass. The delay calibration is an antenna based calibration solution and it can be derived in {{gaincal}} with ''caltype='K' ''. <br />
<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx', caltable='delays.cal', field='5', <br />
refant='ea02', gaintype='K', gaintable=['antpos.cal','gaincurve.cal','opacity.cal'])<br />
</source><br />
<br />
We use the strong bandpass calibrator for the solution. It will be extrapolated in time to all observations.<br />
<br />
This call also exemplifies how the CASA calibration table system works. Calibration tables are incremental. So we supply the previous 'antpos.cal', 'gaincurve.cal', and 'opacity.cal' tables as input to {{gaincal}}. The following calibration step will require ''gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delay.cal']'' and so on. <br />
<br />
<br />
Now we proceed to the actual bandpass calibration: <br />
Since the bandpass calibrator is quite strong we do the phase-only<br />
solution on the integration time of 10 seconds (solint='int').<br />
<br />
<br />
[[Image:Prebp_phasecal2.png|thumb|Phase only calibration before bandpass. The 4 lines are both polarizations in both spw, unfortunately two of them get the same color green.]]<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='bpphase.gcal',<br />
field='5',spw='0~1:20~40',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal'])<br />
</source><br />
<br />
Plot the solutions (note that {{plotms}} can also be used for plotting calibration tables:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='bpphase.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-180,180])<br />
</source><br />
<br />
These solutions will appear in the CASA plotter gui. If you closed it after plotting the antennas above, it should reopen. If it is still open from before, the new plots should just appear. After you are done looking at the first set of plots, push the "Next" button on the GUI to see the next set of antennas.<br />
<br />
Now we can apply this phase solution on the fly while determining<br />
the bandpass solutions on the timescale of the bandpass calibrator scan (solint='inf'). <br />
<br />
We also use the opacity list now instead of myTau -- but both options will work.<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='day2_TDEM0003_10s_norx',caltable='bandpass.bcal',field='5',<br />
refant='ea02',solint='inf',solnorm=T,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bpphase.gcal'])<br />
</source><br />
<br />
'''A few words about solint and combine:'''<br />
<br />
The use of solint='inf' in {{bandpass}} will derive one bandpass<br />
solution for the whole J1229+0203 scan. Note that if there had been two observations of the bandpass calibrator (for example), this command would have combined the data from both scans to form one bandpass solution, because the default of the combine parameter for '''{{bandpass}}''' is combine='scan'. To solve for one bandpass for each bandpass calibrator scan you would also need to include combine='''' '''' in the bandpass call. In all calibration tasks, regardless of solint, scan boundaries are only crossed when combine='scan'. Likewise, field (spw) boundaries are only crossed if combine='field' (combine='spw'), the latter two are not generally good ideas for bandpass solutions. <br />
<br />
Plot the solutions, amplitude and phase:<br />
[[Image:Bandpass_amp.png|thumb|Amplitude Bandpass solutions]]<br />
[[Image:Bandpass-afterdelays.png|thumb|Phase Bandpass solutions]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='bandpass.bcal',xaxis='chan',yaxis='amp',<br />
iteration='antenna',subplot=331)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='bandpass.bcal',xaxis='chan',yaxis='phase',<br />
iteration='antenna',subplot=331)<br />
</source><br />
<br />
Note the scale for the phasesm, they are very small since the delays were already taken out in a previous setp.<br />
<br />
This step isn't necessary from a calibration perspective, but if you<br />
want to go ahead and check the bandpass calibration on the bandpass<br />
calibrator you can run {{applycal}} here. In the future we hope to plot<br />
corrected data on-the-fly without this {{applycal}} step. Subsequent applycals<br />
will overwrite this one, so no need to worry.<br />
<br />
[[Image:Applybandpass_phase.png|thumb|Phase as a function of channel, plotting the corrected data (after Custom and upping "Style" to 3.)]]<br />
<br />
<source lang="python"><br />
applycal(vis='day2_TDEM0003_10s_norx',field='5',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal'],<br />
gainfield=['','','','5','5'],<br />
calwt=F)<br />
</source><br />
<br />
{{applycal}} works like a matrix. The first entries in the lists are to be used together, so are the second entries etc. (except for the opacity list, which is referring to spws). All will be applied to the 'field' selection. In the above example, 'antpos.cal' from any field is applied to source '5', and the 'bandpass.cal' that was obtained for field '5' (the bandpass observation) is also applied to field '5'. Again, lists within the lists are fine. <br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='phase',ydatacolumn='corrected',<br />
correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='amp',ydatacolumn='corrected',<br />
correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
<br />
Note that the phase and amplitude as a function of channel are very flat now.<br />
<br />
==Gain Calibration==<br />
<br />
Now that we have a bandpass solution to apply, we can solve for the antenna-based phase and amplitude gain calibration. Since the phase changes on a much shorter timescale than the amplitude, we will solve for them separately. In particular, if the phase changes significantly over a scan time, the amplitude would be decorrelated, if the un-corrected phase were averaged over this timescale. Note that we re-solve for the gain solutions of the bandpass calibrator, so we can derive new solutions that are corrected for the bandpass shape. Since the bandpass calibrator will not be used again, this is not strictly necessary, but is useful to check its calibrated flux density for example. We use a minimum signal-to-noise of 2 here as it seems to be a good compromise for using good data without rejecting too many solutions (minsnr = 2). <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='intphase.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal'])<br />
</source><br />
[[Image:allcal_phaseint2.png|thumb|Plot of phase solutions on an integration time.]]<br />
<br />
Here solint='int' coupled with calmode='p' will derive a single phase solution for each 10 second integration. Note that the bandpass table is applied on-the-fly before solving for the phase solutions, however the bandpass is NOT applied to the data permanently until applycal is run later on.<br />
<br />
Note that quite a few solutions are rejected due to SNR < 2 (printed to terminal). For the most part it <br />
is only one or two solutions out of >30 so this isn't too worrying. Take note if you see large numbers of rejected solutions per integration. This is likely an indication that solint is too short for the S/N of the data.<br />
<br />
Now look at the phase solution, and note the obvious scatter within a scan time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='intphase.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-180,180])<br />
</source><br />
<br />
Although solint='int' (i.e. the integration time of 10 seconds) is the best choice to apply before for solving for the amplitude solutions, it is not a good idea to use this to apply to the target. This is because the phase-scatter within a scan can dominate the interpolation between calibrator scans. Instead, we also solve for the phase on the scan time, solint='inf' (but combine='''' '''', since we want one solution per scan) for application to the target later on. '''Unlike the bandpass task,''' for gaincal, the default of the combine parameter is combine='''' ''''.<br />
[[Image:allcal_phaseinf2.png|thumb|Plot of phase solutions on a scan time.]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='scanphase.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal'])<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='scanphase.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-180,180])<br />
</source><br />
<br />
Note that there are no failed solutions here because of the added S/N afforded by the longer solint.<br />
Alternatively, instead of making a separate phase solution for application to the target, one can also run {{smoothcal}} to smooth the solutions derived on the integration time.<br />
<br />
Next we apply the bandpass and solint='int' phase-only calibration solutions on-the-fly to derive amplitude solutions. <br />
Here the use of solint='inf', but combine='''' '''' will result in one solution per scan interval.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='amp.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='ap',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal'])<br />
</source><br />
[[Image:allcal_ampphase.png|thumb|Plot of residual phase solutions on a scan time]]<br />
<br />
Now let's look at the resulting phase solutions. Since we have taken out the phase as best we can by applying the solint='int' phase-only solution, this plot will give a good idea of the residual phase error. If you see scatter of more than a few degrees here, you should consider going back and looking for more data to flag, particularly bad timeranges etc.<br />
<br />
<source lang="python"><br />
# In CASA <br />
plotcal(caltable='amp.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[-1,-1,-20,20])<br />
</source><br />
<br />
Note that we have restricted the plot range so that all antennas are plotted with the same scale (instead of autoscaled; the "-1,-1" values for the x-axis allow autoscaling to take place still). We can see that both antenna ea12 (all times) and ea23 (first 1/3 of observation) show particularly large residual phase noise.<br />
[[Image:allcal_amp.png|thumb|Plot of amplitude solutions on a scan time]]<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='amp.gcal',xaxis='time',yaxis='amp',<br />
iteration='antenna',subplot=331,plotrange=[-1,-1,0,1])<br />
</source><br />
<br />
Note that the amplitude solutions for ea12 are very low, in particular when you set plotrange=[-1,-1,0,1]; this is another indication that this antenna is dubious.<br />
<br />
Next we use the flux calibrator (whose flux density was set in {{setjy}} above) to derive the flux of the other calibrators. Note that as of CASA 4.0 the flux table it can be written as an incremental table, just like all other calibration tables. In that case it won't replace the amp.gcal but both tables, amp.gcal as well as flux.gcal need to be carried onward. <br />
<br />
<source lang="python"><br />
# In CASA<br />
fluxscale(vis='day2_TDEM0003_10s_norx',caltable='amp.gcal',<br />
fluxtable='flux.cal',reference='7',incremental=T)<br />
</source><br />
<br />
[[Image:allcal_flux.png|thumb|Plot of flux corrected amplitude solutions.]]<br />
It is a good idea to note down for your records the derived flux densities:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Found reference field(s): J1331+3030<br />
Found transfer field(s): J0954+1743 J1229+0203<br />
Flux density for J0954+1743 in SpW=0 (freq=3.63872e+10 Hz) is: 0.224612 +/- 0.0309939 (SNR = 7.24698, N = 38)<br />
Flux density for J0954+1743 in SpW=1 (freq=3.63045e+10 Hz) is: 0.231628 +/- 0.0299344 (SNR = 7.73785, N = 38)<br />
Flux density for J1229+0203 in SpW=0 (freq=3.63872e+10 Hz) is: 27.7044 +/- 0.246888 (SNR = 112.215, N = 38)<br />
Flux density for J1229+0203 in SpW=1 (freq=3.63045e+10 Hz) is: 26.9803 +/- 0.258681 (SNR = 104.299, N = 38)<br />
</pre><br />
<br />
<!--<br />
Fitted spectral index for J0954+1743 with fitorder=1: spectral index=-12.4865 +/- 2.30427e-05<br />
Fitted spectral index for J1229+0203 with fitorder=1: spectral index=9.00262 +/- 0<br />
--><br />
<br />
<!--<br />
Next, check that the flux.cal table looks as expected:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='flux.cal',xaxis='time',yaxis='amp',<br />
iteration='antenna',subplot=331)<br />
</source><br />
<br />
Note the odd behavior for antennas ea07, ea12, and ea23.<br />
--><br />
<br />
==Applycal and Inspect==<br />
<br />
Now we apply the calibration to each source, according to which tables are appropriate, and which source should be used to do that particular calibration. For the calibrators, all bandpass solutions come from the bandpass calibrator (id=5), and the phase and amplitude calibration comes from their own solutions. <br />
<br />
'''Note:''' In all {{applycal}} steps we set calwt=F. It is very important to turn off this parameter which determines if the weights are calibrated along with the data. Data from antennas with better receiver performance and/or longer integration times should have higher weights, and it can be advantageous to factor this information into the calibration. During the VLA era, meaningful weights were available for each visibility. However, at the time of this observation, the VLA was not yet recording the information necessary to calculate meaningful weights. Since these data weights are used at the imaging stage you can get strange results from having calwt=T when the input weights are themselves not meaningful, especially for self-calibration on resolved sources (your flux calibrator and target, for example). <br />
<br />
For more recent data, the switched power information is recorded, but we currently do not recommend using this information to calculate data weights without exercising considerable caution.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the gain/phase calibrator (field '2'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='2',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the bandpass calibrator (field '5'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='5',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','5','5','5'],<br />
calwt=F)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the flux calibrator (field '7'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='7',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','7','7','7'],<br />
calwt=F)<br />
</source><br />
<br />
For the target we apply the bandpass from id=5, and the calibration from the gain calibrator (id=2):<br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the target source IRC10216 (field '3'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='3',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','scanphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
</source><br />
<br />
Now inspect the corrected data:<br />
[[Image:applycal_inspect.png|thumb|Plot of calibrated amplitudes over time.]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='', coloraxis='antenna1')<br />
</source><br />
<br />
This plot shows some data deviating from the average amplitudes. Use methods described above to <br />
mark a region for a small number of deviant data points, and click "Locate". You will find that ea12 is responsible.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='', coloraxis='antenna2')<br />
</source><br />
<br />
Here we see some problems, with high points. Mark some regions<br />
and locate in {{plotms}} to find out which antennas and in which spws. Pay special<br />
attention to antennas that have been called out already as showing some dubious behavior.<br />
<br />
What you find is that ea07 which we flagged spw=1 above, is also bad for the same timerange in spw=0. This was not obvious in the raw data, because spw=0 was adjusted in the on-line system by a gain attenuator, while spw=1 wasn't. So a lack of power on this antenna can look like very low (and obvious) amplitudes in spw=1 but not for spw=0. Looking carefully you'll see that ea07 is actually pretty noisy throughout.<br />
[[Image:ea12.png|thumb|Plot of antenna ea12 by itself]]<br />
[[Image:ea23.png|thumb|Plot of antenna ea23 by itself]]<br />
<br />
From the locate we also find that ea12 and ea23 show some high points; to see this, replot baselines using each of them alone:<br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='ea12', coloraxis='antenna2')<br />
</source><br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='ea23', coloraxis='antenna2')<br />
</source><br />
<br />
It may be a a good idea to flag ea12 completely - it's just a bit noisy all around and ea23 is pretty noisy during the first scans between initial and second pointing. Recall that these are antennas we became suspicious of while inspecting the calibration solutions.<br />
<br />
[[Image:target_uvdist.png|thumb|IRC+10216 as a function of uv-distance.]]<br />
Now let's see how the target looks. Because the target has resolved structure, its best to look at it as<br />
a function of uvdistance. We'll go ahead and exclude the three antennas we already know have problems.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='!ea07;!ea12;!ea23', coloraxis='antenna2')<br />
</source><br />
<br />
The color indicates that the spikes are caused by a single antenna. Use, zoom, mark, and locate to see which one.<br />
Also look at spw=1.<br />
<br />
The bad antenna turns out to be ea28; to confirm, replot with antenna=!ea28:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='!ea07;!ea12;!ea23;!ea28', coloraxis='antenna2')<br />
</source><br />
<br />
Looks much better! To see if it's restricted to a certain time, do:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='ea28', coloraxis='antenna1')<br />
</source><br />
<br />
Baselines with ea28 clearly show issues until about two-thirds of the way through the observation. <br />
Plot another distant antenna to compare. We will go ahead and flag it all, since it's hanging far out on the north<br />
arm by itself.<br />
<br />
The additional data we've identified as bad need to be flagged, and then all the calibration steps will need to be run again.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='day2_TDEM0003_10s_norx',<br />
mode='list',<br />
inpfile=["antenna='ea07,ea12,ea28'",<br />
"antenna='ea07,ea23' timerange='03:21:40~04:10:00'"])<br />
</source><br />
<br />
==Redo Calibration after more Flagging==<br />
<br />
After flagging, you'll need to repeat the calibration steps above. Here, we append _redo to the table names to distinguish them from the first round, in case we want to compare with previous versions. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='bpphase_redo.gcal',<br />
field='5',spw='0~1:20~40',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal'])<br />
#<br />
bandpass(vis='day2_TDEM0003_10s_norx',caltable='bandpass_redo.bcal',<br />
field='5',<br />
refant='ea02',solint='inf',solnorm=T,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bpphase_redo.gcal'])<br />
#<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='intphase_redo.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal'])<br />
#<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='scanphase_redo.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal'])<br />
#<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='amp_redo.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='ap',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal'])<br />
#<br />
fluxscale(vis='day2_TDEM0003_10s_norx',caltable='amp_redo.gcal',<br />
fluxtable='flux_redo.cal',reference='7',incremental=T)<br />
</source><br />
<br />
<pre style="background-color: #fffacd;"><br />
Flux density for J0954+1743 in SpW=0 (freq=3.63872e+10 Hz) is: 0.242404 +/- 0.0287249 (SNR = 8.43881, N = 32)<br />
Flux density for J0954+1743 in SpW=1 (freq=3.63045e+10 Hz) is: 0.233989 +/- 0.0293236 (SNR = 7.97952, N = 32)<br />
Flux density for J1229+0203 in SpW=0 (freq=3.63872e+10 Hz) is: 26.7488 +/- 0.287326 (SNR = 93.0955, N = 32)<br />
Flux density for J1229+0203 in SpW=1 (freq=3.63045e+10 Hz) is: 26.2045 +/- 0.294954 (SNR = 88.8426, N = 32)<br />
</pre><br />
Feel free to pause here and remake the calibration solution plots from above, just be sure to put in the revised table names.<br />
<br />
==Redo Applycal and Inspect==<br />
<br />
Now, apply all the new calibrations, which will overwrite the old ones. These commands are identical to those above, with the exception of the _redo part of each calibration filename.<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='day2_TDEM0003_10s_norx',field='2',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
#<br />
applycal(vis='day2_TDEM0003_10s_norx',field='5',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','5','5','5'],<br />
calwt=F)<br />
#<br />
applycal(vis='day2_TDEM0003_10s_norx',field='7',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','7','7','7'],<br />
calwt=F)<br />
#<br />
applycal(vis='day2_TDEM0003_10s_norx',field='3',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','scanphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
</source><br />
<br />
[[Image:gaincal_corrflag.png|thumb|Gain calibrator after further flagging and recalibration]]<br />
[[Image:target_corrflag.png|thumb|IRC+10216 after further flagging and recalibration (after selecting colorize by spw).]]<br />
<br />
Now you can inspect the calibrated data again. Except for random scatter things look pretty good.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='', coloraxis='antenna2')<br />
</source><br />
<br />
You can use the Mark and Locate buttons to assess that the remaining scatter seems random, i.e. no particular antenna or time range appears to be responsible.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0~1:4~60',antenna='', coloraxis='spw')<br />
</source><br />
<br />
==Split==<br />
<br />
Now we split the data into individual files. This is not strictly necessary, as you can select the appropriate fields in later clean stages, but it is safer in case for example you get confused with later processing and want to fall back to this point (this is especially a good idea if you plan to do continuum subtraction or self calibration later on). It also makes smaller individual files in case you want to copy to another machine or colleague.<br />
<br />
Here, we split off the data for the phase calibrator and the target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='day2_TDEM0003_10s_norx',outputvis='J0954',<br />
field='2')<br />
#<br />
split(vis='day2_TDEM0003_10s_norx',outputvis='IRC10216',<br />
field='3')<br />
</source><br />
<br />
<!--<br />
To reinitialize the scratch columns for use by later tasks, we need to run clearcal for both new datasets<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearcal(vis='J0954')<br />
#<br />
clearcal(vis='IRC10216')<br />
</source><br />
--><br />
<br />
This concludes the calibration phase of the data reductions.<br />
<br />
== UV Continuum Subtraction and Setting Up for Self-Calibration==<br />
<br />
[[Image:irc10216_uvspec.png|thumb|UV-plot of the spectral line signal in both spw for IRC+10216.]]<br />
<br />
Now we can make a vector averaged uv-plot of the calibrated target spectral line data. It is important to note that you will only see signal in such a plot if (1) the data are well calibrated, and (2) there is significant signal near the phase center of the observations, or if the line emission (or absorption) is weak but extended. If this isn't true for your data, you won't be able to see the line signal in such a plot and will need to make an initial (dirty or lightly cleaned) line+continuum cube to determine the line-free channels. Generally, this is the recommended course for finding the line-free channels more precisely than is being done here due to time constraints, as weak line signal would not be obvious in this plot. <br />
<br />
<source lang="python"><br />
plotms(vis='IRC10216',field='',ydatacolumn='corrected',<br />
xaxis='channel',yaxis='amp',correlation='RR',<br />
avgtime='1e8',avgscan=T,spw='0~1:4~60',antenna='', coloraxis='spw')<br />
</source><br />
<br />
In the Display tab, change the Unflagged Points Symbol to Custom and Style of 3. <br />
<br />
You should see the "horned profile" typical of a rotation shell. From this plot, you can guess that strong <br />
line emission is restricted to channels 18 to 47 (zoom in if necessary to see exactly what the channel numbers are). <br />
<br />
In the Data tab, under Averaging, you can also click on "All Baselines" to average all baselines, but this is a little harder to see.<br />
<br />
Now we want to use the line free channels to create a model of the continuum emission that can be subtracted to form a line-only dataset. We want to refrain from going to close to the edges of the band -- these channels are typically noisy, and we don't want to get too close to the line channels because we could only see strong line emission in the vector averaged uv-plot.<br />
<br />
We can now either specify the line free channels via fitspw='0~1:4~13;52~63' and excludechans=F in {{uvcontsub}}, or do the inverse selection via<br />
<br />
<source lang="python"><br />
uvcontsub(vis='IRC10216',fitspw='0~1:14~51',excludechans=T,<br />
want_cont=T)<br />
</source><br />
<br />
which excludes the line channels from the continuum fit.<br />
<br />
The "want_cont=T" will produce two new datasets, IRC10216.contsub is the continuum subtracted line data, and IRC10216.cont is the continuum estimate (note however, that it is still a multi-channel dataset).<br />
<br />
==Velocity Systems and Doppler corrections==<br />
<br />
The Jansky VLA does not support Doppler tracking. Doppler setting is possible which will calculate the sky frequency based on a velocity of the source at the start of an observation. The sky frequency is then fixed throughout that track. Typically, a fixed frequency is better for the calibration of interferometric data. The downside, however, is that a spectral line may shift over one or more channels during an observation. {{clean}} takes care of such a shift when regridding the visibilities in velocity space (default is LSRK) to form an image. Sometimes, in particular when adding together different observing tracks, it may be advisable to regrid all data sets to the same velocity grid, combine all data to a single file, then Fourier transform and deconvolve. The tasks {{cvel}}, {{concat}}, and {{clean}} serve this purpose respectively. The following run of {{cvel}} shows an example on how the parameters of {{cvel}} may be set. <br />
<br />
The '''IRC10216.contsub''' visibility spans the following channel range (see also the listobs output in the first part of the tutorial): <br />
<br />
<source lang="python"><br />
# In CASA<br />
vishead(vis='IRC10216.contsub', mode='summary')<br />
</source><br />
<br />
<pre style="background-color: #fffacd;"><br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 Subband:0 64 TOPO 36387.229 125.000 8000.0 RR RL LR LL<br />
1 Subband:0 64 TOPO 36304.542 125.000 8000.0 RR RL LR LL<br />
</pre><br />
<br />
For spw 0, this corresponds to about 1 km/s channel width. If we want to image the HC3N spectral line with a rest frequency of 36.39232 GHz over a velocity range of -50km/s to 0km/s and a channel width of 5 km/s, we may decide to regrid the visibilities in {{cvel}} as<br />
<br />
'''Note that this step is not necessary for the processing further down in this tutorial. You may skip it if you wish.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
cvel(vis='IRC10216.contsub', outputvis='IRC10216.contsub-cveled', mode='velocity',<br />
interpolation='linear', nchan=10, start='-50km/s', width='5km/s',<br />
restfreq='36.39232GHz',outframe='LSRK', veltype='optical') <br />
</source><br />
<br />
This will create a new dataset where the data is binned into the new grid. Since all data in measurement sets are stored in frequency space, an inspection with {{vishead}} now gives:<br />
<br />
<source lang="python"><br />
# In CASA<br />
vishead(vis='IRC10216.contsub-cveled', mode='summary')<br />
</source><br />
<br />
<pre style="background-color: #fffacd;"><br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 Subband:0 10 LSRK 36392.927 606.974 6070.6 RR RL LR LL<br />
</pre><br />
<br />
After the {{cvel}} step, the data can then be combined with other observations via {{concat}} and imaged in {{clean}} with mode='channel' to conserve that velocity system and grid.<br />
<br />
Note that {{cvel}} can also Hanning smooth the data, if needed (as an alternative to the stand-alone {{hanningsmooth}} task).<br />
<br />
==Image the Spectral Line Data==<br />
<br />
Here we make images from the continuum-subtracted, calibrated spectral line data. Because the spectral line emission from IRC+10216 has significant extended emission, it is very important to run clean interactively, and make a clean mask. To make the cube a bit smaller and stay away from noisy edge channels we restrict the <br />
channel range using the spw parameter.<br />
[[Image:viewer_interactive.png|thumb|Channel 32 shown for the HC3N cube shown in the interactive viewer with the white contour showing the mask contour drawn with the polygon tool.]]<br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_HC3N.cube_r0.5',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='0:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.39232GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
interactive=T,<br />
threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
* imagermode = csclean will invoke the Cotton-Schwab cleaning algorithm and the data will be regridded into a new output velocity frame, correcting for Doppler shifts of the line during the run (VLA data for each track is always topocentric at a fixed sky frequency). The iterations are chosen as a high value to allow many clean cycles when needed. Typically, however, the threshold will kick in earlier and stop the cleaning process. <br />
<br />
It will take a little while to grid the data, but the {{viewer}} will open when it's ready to start an interactive clean. Use the "Channels tape deck" at the bottom of the Viewer display GUI to step through to the channel with the most extended (in angular size) emission, select "all channels" for the clean mask, select the polygon tool (the 'R' with the wobbly line around it) and make a single mask that applies to all channels (see example in thumbnail). Once you make the polygon region, you need to double click inside it to save the mask region -- if you see the polygon turn white you will know you succeeded. Note, that if you had the time and patience you could make a clean mask for each channel, and this would create a slightly better result. <br />
<br />
After making the mask you should check that the emission in all the other channels fits within the mask you made using the "tape deck" to move back and forth. If you need to include more area in the mask, you can chose the "erase" toggle at the top, and then encircle your existing mask with a polygon and double click inside. Then go back to "add" toggle at top and make a new mask. Alternatively, you can erase a part of the mask, or you can add to the existing mask by drawing new polygons. Feel free to experiment with this a bit.<br />
<br />
'''Note''': If you start an interactive clean, and then do not make a mask, clean will stop when you tell it to go on because it has nothing to clean. There is no default mask. <br />
<br />
To continue with {{clean}} use the "Next action" buttons in the green area on the Viewer Display GUI: The red X [[File:clean-stop.png]] will stop {{clean}} where you are, the blue arrow [[File:clean-continue.png]] will stop the interactive part of {{clean}}, but continue to clean non-interactively until reaching the stopping niter ('''note that this is "iterations" x "cycles"''') or threshold (whichever comes first), and the green arrow [[File:clean-redo.png]] will clean until it reaches the "iterations" parameter on the left side of the green area. When <br />
the interactive viewer comes back use the tape deck to recheck that your mask encompasses what you think is real emission. The middle mouse button by default controls the image stretch.<br />
<br />
Note that for this example, threshold has been set to <tt>threshold = '3mJy'</tt> to protect you from cleaning too deeply. With a careful clean mask you can clean to close to the thermal noise limit (note here I mean the actual observed rms noise limit and not the theoretical one you calculated for the proposal, as flagging, weather, etc. can affect what you actually get). It is ALWAYS best to clean each channel in a cube to a specific threshold than to stop by simply using the niter parameter, which can leave each channel cleaned to different levels. There are many ways to determine a suitable threshold. One way is to make a dirty image (<tt>niter = 0</tt>), open the cube using the viewer, go to a line free channel, select the box region tool, make a box near the field center about the size of your source, and double click inside. The rms noise of that channel will appear in the terminal window from which the {{viewer}} was launched. Try a few different boxes, average the results and this is a good estimate of the rms per channel assuming your data are not dynamic range limited (i.e. noise can be higher in channels with strong signal). This is the absolute minimum for threshold. With no mask you probably shouldn't clean deeper than 3x this rms. <br />
<br />
[[Image:SiS_interactive.png|thumb|Channel 43 shown for the SiS cube in the interactive viewer with the white contour showing the mask contour drawn with the polygon tool.]]<br />
<br />
Keep cleaning, by using the green Next Action arrow [[File:clean-redo.png]] until the residual displayed in the viewer looks "noise like". To speed things up, you might change the iteration parameter in the viewer to something like 300. This parameter can also be set in the task command. You will notice that in this particular case, there are residuals that cannot be cleaned -- these are due to the extended resolved out structure on size scales larger than the array is sensitive to (the "Largest Angular Scale" or LAS that the array is sensitive to can be calculated from the shortest baseline length), and potential residual phase and amplitude calibration errors. We will explore this in a few sections with self-calibration. <br />
<br />
Repeat the process for the SiS line using the call below, note that the emission for this line is less extended than the HC3N -- this has to do with the different excitation requirements of the two different lines. The SiS is excited closer to the central star than the HC3N.<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_SiS.cube_r0.5',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='1:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.30963GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
interactive=T, <br />
threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
You can look at both cubes using the viewer, and the tape deck to play the cube as a "movie".<br />
<source lang="python"><br />
# In CASA<br />
viewer<br />
</source><br />
<br />
==Image the Continuum data==<br />
<br />
Below the use of mode='mfs' will make a single multi-frequency synthesis image out of the specified spw/channels. Again you should make an interactive clean mask. Since no threshold is set, you will need to stop cleaning when the residual looks noise like using the red x "Next Action" button (it will be done when the viewer comes back the second time). The continuum for IRC10216 is very weak but interesting -- it is essentially tracing the photosphere of the AGB star. <br />
<br />
The continuum data set produced with wantcont=True in uvcontsub2 is the model fit. To image the continuum itself, use the line-free channels.<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216',imagename='IRC10216.36GHzcont',<br />
mode='mfs',imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='0~1:5~14,0~1:48~59',<br />
weighting='briggs',robust=0.5,<br />
interactive=T)<br />
</source><br />
<br />
Now look at the result in the viewer, if you like:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer<br />
</source><br />
<br />
==Image Analysis and Viewing==<br />
<br />
Next make integrated intensity maps (moment 0) and intensity-weighted velocity maps (moment 1). For HC3N, we also produce a velocity dispersion, peak flux, and median map. All are derived with {{immoments}}. To do this, we'll want to know what channels the line emission starts and ends on, and also the rms noise in a single channel. So first lets open the viewer:<br />
<br />
<source lang="python"><br />
# In CASA <br />
viewer<br />
</source><br />
<br />
Then use the Viewer tape deck to see which channels have significant line emission. For HC3N, the line channel range in the cube is 16 to 45, and it is the same for SiS. <br />
<br />
[[Image:irc10216.jpg|thumb|HC3N moment 0 map with white continuum contours superposed.]]<br />
[[Image:irc10216_sismom0.jpg|thumb|SiS moment 0 map with white continuum contours superposed.]]<br />
<br />
Then use the tape deck to go to a line free channel, select the box region tool and make a box. When you double click in the box, the image statistics for the channel you are on will print to the terminal. Move the box around a bit to see what the variation in rms noise is. You should get something like 2 mJy. Note that the rms is much worse in channels with strong emission because of the low dynamic range of these data. If you want the box tool to go away (i.e. if you want to make a new one), hit the escape key. <br />
<br />
Now let's make the moment 0 and moment 1 maps. For moment zero, it's best to limit the calculation to image channels with significant signal in them, but not to apply a flux cutoff, as this will bias the derived integrated intensities upward.<br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_HC3N.cube_r0.5.image',moments=[0],<br />
axis='spectral',<br />
chans='16~45',<br />
outfile='IRC10216_HC3N.cube_r0.5.image.mom0')<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_SiS.cube_r0.5.image',moments=[0],<br />
axis='spectral',<br />
chans='16~45',<br />
outfile='IRC10216_SiS.cube_r0.5.image.mom0')<br />
</source><br />
<br />
To have a look at these, use the viewer:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('IRC10216_HC3N.cube_r0.5.image.mom0')<br />
#<br />
viewer('IRC10216_SiS.cube_r0.5.image.mom0')<br />
</source><br />
<br />
For moment 1, it is essential to apply a conservative flux cutoff to limit the calculation to high signal-to-noise areas. Here we use about 5&sigma;:<br />
<br />
[[Image:irc10216_dust_HC3N_cont.png|thumb|The VLT V-band image from Le&atilde;o et al. (2006, A&A, 455,187) showing dust rings, overlaid with white HC3N moment 0 contours and black 36 GHz continuum contours.]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_HC3N.cube_r0.5.image',moments=[1],<br />
axis='spectral',<br />
chans='16~46',excludepix=[-100,0.01],<br />
outfile='IRC10216_HC3N.cube_r0.5.image.mom1')<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_SiS.cube_r0.5.image',moments=[1],<br />
axis='spectral',<br />
chans='16~45',excludepix=[-100,0.01],<br />
outfile='IRC10216_SiS.cube_r0.5.image.mom1')<br />
</source><br />
<br />
Finally, we will do velocity dispersion, peak flux, and median map in a single step for HC3N. {{immoments}} can perform these steps even though the latter two are not 'moments' in a mathematical sense. Check the help file to find out the options. Peak flux and median are produced with the moment parameter set to 8 and 3:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_HC3N.cube_r0.5.image',moments=[2,8,3],<br />
axis='spectral',<br />
chans='16~46',excludepix=[-100,0.01],<br />
outfile='IRC10216_HC3N.cube_r0.5.image.extramoms')<br />
</source><br />
<br />
will create the files IRC10216_HC3N.cube_r0.5.image.extramoms.weighted_dispersion_coord, IRC10216_HC3N.cube_r0.5.image.extramoms.median, and IRC10216_HC3N.cube_r0.5.image.extramoms.maximum.<br />
<br />
Now use the viewer to further explore the images you've made.<br />
<br />
For fun you can download the VLT V-band image at http://casa.nrao.edu/Data/EVLA/IRC10216/irc_fors1_dec_header.fits kindly provided by <br />
Izan Le&atilde;o and overlay the moment images and 36 GHz continuum. More information about the dust properties can be found in the Le&atilde;o et al. (2006) paper http://adsabs.harvard.edu/abs/2006A%26A...455..187L.<br />
<br />
The creation of position velocity cuts from the viewer is currently being developed and hopefully available soon in CASA. If you are interested in a work-around, you may have a look at the [[How_to_rotate_and_slice_a_cube_for_pV_diagrams|pV casaguide]]. Masking the data cube to extract the emission is described [[Masking_images_for_analysis|here]].<br />
<br />
== Spectrum Fitting ==<br />
<br />
Frequently, one would like to fit Gaussians or polynomials to the spectral line in the data cube. This can be done with CASA's {{specfit}} task. {{specfit}} can fit those functions to an average spectrum define by some bounding box, or, alternatively, for each pixel. In the following, we will do both.<br />
<br />
=== Fitting an average spectrum ===<br />
<br />
[[Image:viewer-irc-specfit1.png|thumb|The viewer showing the cube at plane 34. The green box marks the region that is averaged for the spectral profile. ]]<br />
<br />
[[Image:viewer-irc-specfit1-profile.png|thumb|Spectral profile of the HC3N line within the green rectangle.]]<br />
<br />
First, we want to inspect the spectrum. Load the image into the viewer (here: the HC3N image cube), select '''"spectral profile"''' from the '''Tools''' menu and open a region with the mouse button that is assigned to the rectangular '''"R"''' region in the tool bar. Best to do this at a plane that shows the entire extent of the source. The average spectrum will be displayed in a separate panel.<br />
<br />
To fit this profile in {{specfit}}, we need a region file outlining the 2-D region that is averaged (the green box in the viewer screenshot).<br />
In the following we use the new CASA region format (CASA 3.3 and higher) that is described [[CASA Region Format | here]]. Following the guidelines on that page, we create a file named '''specfit.crtf''' that describes a box with its [[x1,y1],[x2,y2]] corners in J2000 RA DEC coordinates.<br />
<br />
<pre style="background-color: #fffacd;"><br />
#CRTFv0<br />
box[[09:47:59.2, 13.16.24], [09:47:55.8, 13.17.09]]<br />
</pre><br />
<br />
We will fit 2 Gaussians to the two peaks of the spectrum (the scientific merit is debatable). A file with initial values for the fit can be provided via the '''estimates''' parameter - see {{specfit}} for details. Here we will let CASA figure out the start values by itself: <br />
<br />
<source lang="python"><br />
# In CASA<br />
myfit = specfit(imagename='IRC10216_HC3N.cube_r0.5.image', region='specfit.crtf', multifit=F,<br />
estimates='', ngauss=2) <br />
<br />
</source><br />
<br />
Note that the output is stored in a Python dictionary called "myfit", as well as printed to the CASA logger. You should get something similar to this (depending on the details of flagging etc.):<br />
<br />
<pre style="background-color: #fffacd;"><br />
Fit :<br />
RA : 09:47:57.505<br />
Dec : +13.16.46.460<br />
Stokes : I<br />
Pixel : [145.502, 164.499, 0.000, *]<br />
Attempted : YES<br />
Converged : YES<br />
Iterations : 23<br />
Valid : YES<br />
Results for component 0: <br />
Type : GAUSSIAN<br />
Peak : 5.63 +/- 0.43 mJy/beam<br />
Center : -16.08 +/- 0.33 km/s<br />
40.66 +/- 0.32 pixel<br />
7.74 +/- 0.76 pixel<br />
Integral : 47.7 +/- 6.0 mJy/beam.km/s<br />
Results for component 1:<br />
Type : GAUSSIAN<br />
Peak : 4.36 +/- 0.33 mJy/beam<br />
Center : -33.73 +/- 0.56 km/s<br />
23.53 +/- 0.54 pixel<br />
FWHM : 14.5 +/- 1.4 km/s<br />
14.1 +/- 1.4 pixel<br />
Integral : 67.5 +/- 8.4 mJy/beam.km/s<br />
</pre><br />
<br />
which seems to have caught the two peaks pretty well.<br />
<br />
<!--<br />
=== Spectral Fitting pixel by pixel ===<br />
<br />
[[Image:irc-amp0.png|thumb|Output image of {{specfit}} of the amplitude of the first Gaussian component.]]<br />
<br />
{{specfit}} can also fit Gaussians to every spectrum in each single spatial pixel. The following command will do this within the '''spectfit.crtf''' region defined above:<br />
<br />
<source lang="python"><br />
# In CASA<br />
pixfit = specfit(imagename='IRC10216_HC3N.cube_r0.5.image', region='specfit.crtf', ngauss=2,<br />
multifit=T, amp='fit-amp.image', center='fit-center.image', fwhm='fit-fwhm.image')<br />
</source><br />
<br />
In this example, {{specfit}} will produce three images per Gaussian, images that map the best fit values of the Gauss peaks (amplitudes), velocity centers, and full widths at half maximum. For the first Gaussian, the image to the right displays the amplitude image '''fit.amp.image_0'''.<br />
<br />
--><br />
<br />
== Self-Calibration ==<br />
<br />
The many different aspects of self-calibration could fill several casaguides. Here we describe a simple process for this particular relatively low S/N data (low S/N per channel, at least).<br />
<br />
While running {{clean}} above, the model column for each channel will have been filled with the clean model (if you made a Fourier transform of this model, you would see an image of the clean components). <br />
<br />
We choose to do the self cal on the spw=1 SiS line data because it has the strongest emission in a single channel and is a bit more compact than the HC3N data. We will run {{gaincal}} specifying the channel in the uv-data that has the brightest peak in the image (use the {{viewer}} to figure out which channel this is for spw=1), note down what the peak flux is. Since we started the image with a channel range we need to account for the fact that the image channel numbers do not map exactly to the uv-data channel numbers (they are off by 5 so that channel 13 in the image is roughly channel 19 in the uv-data). <br />
<br />
The next thing we need to understand is the S/N of the data. In particular, to self-cal, you need enough signal on a single baseline over the course of your chosen solint to get a S/N of about 3. Above we calculated an average rms noise of about 2 mJy/beam/channel for the whole timerange (about 95 minutes on source time) and all antennas (16). We can use our knowledge of the radiometer equation (see [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary_-_Current#Sensitivity VLA Sensitivity]) where rms scales as 1/sqrt(time * #baselines), and the number of baselines= N(N-1)/2 and N=# of antennas. So the rms noise on one baseline, for one 10 second integration in this observation is given by:<br />
<br />
<math> {\rm RMS(baseline)} = {\rm 2\ mJy\ beam^{-1}\ channel^{-1}} \sqrt{ \frac{95\times 60\ {\rm sec}}{10\ {\rm sec}}\times\frac{16\times 15}{2\times 1}}\ {\sim}\ 500\ {\rm mJy\ beam^{-1}\ channel^{-1}}</math><br />
<br />
[[Image:timeonsource.png|thumb|Plot to estimate the time on source.]]<br />
<br />
The 95 minutes of on-source time can be estimated from a plot like this where you can sum up the amount of time on a source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='1:4~60',antenna='')<br />
</source><br />
<br />
This analysis suggests that the rms noise on one baseline, for one 10 second integration is only about 500 mJy. In contrast, the peak flux density in the strongest SiS channel is only about 200 mJy (you can check using the {{viewer}}). Since the emission is fairly compact, most baselines will see about this peak flux; this is why we choose the more compact of the two possible lines. Thus, a 10 second solution interval is not enough to get a SNR of at least 3 on a 200 mJy peak. We need to use a solint large enough so that the rms noise is not worse than about 1/3 of 200 mJy. Thus, a solint of 10 minutes is about the shortest we can use and be reasonably confident of the solutions. <br />
<br />
Now we run {{gaincal}} with the solint we have determined. Note that because our desired solint is more <br />
than the scan time, we need to include combine='scan'.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='IRC10216.contsub',caltable='pcal_ch19one_10min',<br />
spw='1:19',calmode='p',solint='10min',combine='scan',<br />
refant='ea02',minsnr=3.0)<br />
</source><br />
<br />
[[Image:selfcalone.png|thumb|Phase-only self-calibration solutions with 10 minute solint (second page of the display). ]]<br />
Now let's look at the solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='pcal_ch19one_10min',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-50,50])<br />
</source><br />
<br />
For some antennas you can see clear global trends away from zero: ea08, ea21, and ea24 are examples, and you can also see some smaller variations with time.<br />
<br />
Now let's explore whether applying this solution actually improves matters. To do this we need to run {{applycal}} to apply the solutions to the line dataset, both spw. We need to use spwmap to tell it that the solutions derived for spw=1 should be applied to both spw=0 and spw=1. Again it's important to set calwt=F here.<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='IRC10216.contsub',field='',spw='0,1',<br />
gaintable=['pcal_ch19one_10min'],spwmap=[[1,1]],calwt=F)<br />
</source><br />
<br />
'''Note:''' in this example we ran the self-cal steps on the full uv continuum subtracted spectral line data set. For a more complex iterative self-calibration proceedure, you may find it easier to split off the channel/spw you want to experiment on with {{split}}, and then do all the imaging ({{clean}}) and {{gaincal}} steps with it. The {{gaincal}} tables created on the single channel can still be applied with {{applycal}} to the multi-channel/spw dataset. If you do this though, keep in mind that once split, the single-channel data will have its spw id reset to 0 (you can check with {{listobs}}), no matter what spw it came from. Thus in order to applycal with it you would need <nowiki>spwmap=[[0,0]]</nowiki>.<br />
<br />
To save time we can use the clean mask we made before and run in a non-interactive mode. You can use a mask over again as long as the number of channels in the {{clean}} call haven't changed. You can change cell or imsize and it will still do the right thing.<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_HC3N.cube_r0.5.pselfcal',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='0:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.39232GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
mask='IRC10216_HC3N.cube_r0.5.mask',<br />
interactive=F,threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_SiS.cube_r0.5.pselfcal',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='1:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.30963GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
mask='IRC10216_SiS.cube_r0.5.mask', <br />
interactive=F,threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
Now investigate the original and self-cal'ed images in the viewer. You will find that even this single self-cal step significantly improves the images. Try opening both versions of the SiS image cubes. <br />
Then select a bright channel from the tape deck, then use the "wrench" and "pwrench" guis to make a plot like below setting the same image range for both cubes, and two panels in x, then to see both images of that channel side-by-side click the blink toggle (see image below for more tips on setup.)<br />
<br />
[[Image:compareselfcal.png|600px|Original and self-cal SiS images for channel 37, notice the decrease in <br />
residuals.]]<br />
<br />
Repeat for HC3N:<br />
<br />
[[Image:compareselfcal2.png|600px|Original and self-cal HC3N images for channel 13, notice the decrease in <br />
residuals.]]<br />
<br />
Now you can redo the moment images if you like with the improved cubes (be sure to change the output file). names. <br />
<br />
<br />
[[Main Page | &#8629; '''CASAguides''']]<br />
<br />
--[[User:Cbrogan|Crystal Brogan]] <br />
--additions:[[User:Jott| Juergen Ott]], [[User:Mkrauss| Miriam Krauss]], [[User:Dshepher| Deb Shepherd]]<br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_high_frequency_Spectral_Line_tutorial_-_IRC%2B10216&diff=15947EVLA high frequency Spectral Line tutorial - IRC+102162014-04-03T04:51:49Z<p>Knyland: /* Velocity Systems and Doppler corrections */</p>
<hr />
<div>[[Category:EVLA]][[Category:Calibration]][[Category:Spectral Line]]<br />
<br />
'''Please use CASA 4.2 for this tutorial'''<br />
<br />
<br />
<br />
== Overview ==<br />
[[Image:irc10216_dust.jpg|thumb|VLT V-band image of IRC+10216 showing dust rings out to a radius of 90" by Le&atilde;o et al. (2006, A&A, 455, 187).]]<br />
<br />
This tutorial describes the data reduction for two spectral lines observed toward the AGB star IRC+10216. <br />
In this Jansky VLA "OSRO1" mode observation one subband was observed in each of two basebands, with the subbands centered on the HC3N and SiS lines near 36 GHz. The raw data were loaded into CASA with {{importevla}}, where zero and shadowed data were flagged (note that this is done by the [https://archive.nrao.edu/archive/advquery.jsp NRAO Data Archive]). Then the data were {{split}}, so we could average from the native 1-second integrations to 10 seconds, select only antennas with Ka-band receivers, and select only spectral windows (called spw in CASA) with Ka-band data. This produces a significantly smaller dataset for processing.<br />
<br />
IRC+10216 (CW Leo) is the brightest star in the sky at 5 microns but only 16th magnitude visually. It was discovered during the first survey of the infrared sky, carried out by Bob Leighton and Gerry Neugebauer in 1965. An Asymptotic Giant Branch star, it is a Mira-type variable going through prodigious episodic mass loss. The dust condensed from the atmosphere during the mass loss is responsible for the millimeter emission; the continuum emission seen at radio wavelengths probes the actual stellar photosphere. Molecules form along with the dust, and a steady state chemistry occurs in the dense inner regions (Tsuji 1973 A&A 23, 411). As the density of material drops, the chemistry freezes. But the molecules continue their long coast outward into the Galaxy, and as the shell thins ultraviolet light from the ambient galactic radiation field penetrates and initiates a new chemistry in the gas.<br />
<br />
SiS, a simple molecule created in the dense inner envelope chemistry is photodissociated as it coasts out into the shell. The result is the centrally condensed emission we see in the present observations. Interestingly, in the next lower transition at 18 GHz, the line shape is much different from what we see here. At the extreme velocities in the profile, very bright narrow emission is seen which has been interpreted as maser emission. The interested student can find VLA observations of this line in the archive.<br />
<br />
HC3N, a much more complex species, is created by the photochemistry which becomes active as atoms and pieces of molecules destroyed by ultraviolet radiation undergo the next phase of chemistry in the shell. HC3N has many vibrational modes which may be excited in addition to its rotational modes. Owing to this, it can re-radiate energy absorbed from ultraviolet radiation more effectively than some molecules with a single bond. Eventually it too is destroyed however, but during its brief existence its rise to abundance in the envelope results in a ring of emission, which is what is observed in this image made with the Jansky VLA. A recent model by Cordiner & Millar (2009, ApJ, 697, 68) describes a new chemical model for the shell, which also takes into account the variation of mass loss by the star. They show that in addition to purely chemical effects, local gas and dust density peaks play a role in shaping the observed emission.<br />
<br />
==Getting the data==<br />
<br />
The post-split averaged data can be downloaded from [http://casa.nrao.edu/Data/EVLA/IRC10216/day2_TDEM0003_10s_norx.tar.gz http://casa.nrao.edu/Data/EVLA/IRC10216/day2_TDEM0003_10s_norx.tar.gz] (data size: 1.1GB)<br />
<br />
Once the download is complete, unzip and unpack the file:<br />
<br />
<source lang='bash'><br />
# in a terminal, outside of CASA:<br />
tar -xzvf day2_TDEM0003_10s_norx.tar.gz<br />
</source><br />
<br />
== How to Use This casaguide==<br />
<br />
[[Image:clean.png|thumb|Inputs from one of the clean commands from this tutorial]]<br />
There are a number of possible ways to run CASA. Many aspects are described in [[Getting_Started_in_CASA]]. You should review this page if you are new to CASA. In brief you can run CASA interactively by looking at the inputs to tasks with '''inp taskname''' (example: inp clean), setting the parameters one by one (example: selectdata=T) as you desire and then run '''go'''. After setting parameters one by one in a task and then looking at the inputs again, you will notice that the parameters that have been set to something other than their defaults are blue. If you have mistyped any parameters, they will be red and must be fixed for the task to run correctly. You can get more detailed help on any task by typing '''help taskname''' (example: help clean). Once a task is run you can get the same parameters back by running '''tget taskname''' (example: tget clean); subsequent runs will overwrite the previous tget file. <br />
<br />
The second way to run CASA is to provide task function calls. This tutorial is made up of such calls, which were developed by looking at the inputs for each task and deciding what needed to be changed from default values. For task function calls, '''only parameters that you want to be different from their defaults need to be set'''. A series of task function calls can be combined together into a script, and run with '''execfile('scriptname.py')'''. It is possible to extract a script containing all the CASA task function calls in this and other casaguides using the method described at the [[Extracting_scripts_from_these_tutorials]] page.<br />
<br />
If you are a relative novice or just new to CASA it is strongly recommended to work through this tutorial by cutting and pasting the task function calls provided below after you have read all the associated explanations. Work at your own pace, look at the inputs to the tasks to see what other options exist, and read the help files. Later, when you are more comfortable, you might try to extract the script, modify it for your purposes, and begin to reduce other data.<br />
<br />
<br />
==Initial Inspection and Flagging==<br />
<br />
=== Observing Logs ===<br />
<br />
For all VLA observations, the operators keep an observing log. You can look at<br />
the observing logs at the observing log [http://www.vla.nrao.edu/cgi-bin/oplogs.cgi website] by entering a date range covering only 26 Apr 2010, then selecting "TDEM0003". Pertinent information from this observation is repeated below:<br />
<br />
<pre style="background-color: #E0FFFF;"><br />
INFORMATION FROM OBSERVING LOG:<br />
Date of the observation: 26-April-2010<br />
There are no Ka-band receivers on ea11, ea13, ea14, ea16, ea17, ea18, ea26 <br />
Antenna ea06 is out of the array<br />
Antenna 15 has a focus timeout<br />
Antennas ea10, ea12, ea22 do not have good baseline positions<br />
</pre><br />
<br />
All of that information we should keep in mind during the calibration. E.g. if the mentioned list of unavailable receivers do appear in the data, the data is just noise and should be flagged. For the The dataset that you have downloaded the antennas have already been removed. Also keep an eye on other messages such as loss of data, or subreflector problems, or any other such issues. If they were not captured in the online flagging, they should be carefully looked at, treated appropriately during calibration or flagged. <br />
<br />
To start with, we will have a look at the content of the raw data. {{listobs}} provides almost all relevant observational parameters such as correlator setup (frequencies, bandwidths, channel number and widths, polarization products), sources, scans, scan intents, and antenna locations:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs(vis='day2_TDEM0003_10s_norx')<br />
</source><br />
<br />
Below we have cut and pasted the most relevant output from the logger.<br />
<br />
<pre style="background-color: #fffacd;"><br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
2 D J0954+1743 09:54:56.823626 +17.43.31.22243 J2000 2 65326<br />
3 NONE IRC+10216 09:47:57.382000 +13.16.40.65999 J2000 3 208242<br />
5 F J1229+0203 12:29:06.699729 +02.03.08.59820 J2000 5 10836<br />
7 E J1331+3030 13:31:08.287984 +30.30.32.95886 J2000 7 5814<br />
Spectral Windows: (2 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 Subband:0 64 TOPO 36387.229 125.000 8000.0 RR RL LR LL<br />
Sources: 10<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 J1008+0730 0 0.03639232 -0.026 <br />
0 J1008+0730 1 0.03639232 -0.026 <br />
2 J0954+1743 0 0.03639232 -0.026 <br />
2 J0954+1743 1 0.03639232 -0.026 <br />
3 IRC+10216 0 0.03639232 -0.026 <br />
3 IRC+10216 1 0.03639232 -0.026 <br />
5 J1229+0203 0 0.03639232 -0.026 <br />
5 J1229+0203 1 0.03639232 -0.026 <br />
7 J1331+3030 0 0.03639232 -0.026 <br />
7 J1331+3030 1 0.03639232 -0.026 <br />
Antennas: 19:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 -521.9407 -332.7782 -1.1977 -1601710.017000 -5042006.928200 3554602.355600<br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 9.8247 -20.4292 -2.7808 -1601150.059500 -5042000.619800 3554860.729400<br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 506.0591 -251.8666 -3.5832 -1600715.948000 -5042273.187000 3554668.184500<br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 -27.3562 -41.3030 -2.7418 -1601189.030140 -5042000.493300 3554843.425700<br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1158 -272.1493 -1.5032 -1601614.091000 -5042001.655700 3554652.509300<br />
5 ea07 N06 25.0 m -107.37.06.9 +33.54.10.3 -54.0667 263.8720 -4.2292 -1601162.593200 -5041829.000000 3555095.890500<br />
6 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 -30.8810 -1.4664 -2.8597 -1601185.634945 -5041978.156586 3554876.424700<br />
7 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 236.9058 -126.3369 -2.4443 -1600951.588000 -5042125.911000 3554773.012300<br />
8 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8394 -206.0057 -3.2252 -1600801.916000 -5042219.371000 3554706.449900<br />
9 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 -275.8288 -166.7451 -2.0590 -1601447.198000 -5041992.502500 3554739.687600<br />
10 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 -152.8599 -83.8054 -2.4614 -1601315.893000 -5041985.320170 3554808.304600<br />
11 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 -47.8454 192.6015 -3.8723 -1601168.786100 -5041869.054000 3555036.936000<br />
12 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 -23.8638 -81.1510 -2.5851 -1601192.467800 -5042022.856800 3554810.438800<br />
13 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 -42.5986 132.8623 -3.5431 -1601173.953700 -5041902.660400 3554987.536500<br />
14 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 318.0523 -164.1848 -2.6960 -1600880.570000 -5042170.388000 3554741.457400<br />
15 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 -210.0944 -122.3885 -2.2581 -1601377.008000 -5041988.665500 3554776.393400<br />
16 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 -35.6245 53.1806 -3.1345 -1601180.861480 -5041947.453400 3554921.628700<br />
17 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 50.6647 -39.4832 -2.7249 -1601114.365500 -5042023.153700 3554844.945600<br />
18 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9057 433.1889 -5.0602 -1601147.940400 -5041733.837000 3555235.956000<br />
</pre><br />
<br />
In addition to source names, antenna names, etc. CASA indexes each of these parameters starting from 0. To specify, e.g., a source field, one can use the index or the name -- both are accepted. <br />
<br />
Note that the Rest Frequency and Systemic Velocity are wrong in the listobs log by a factor 10^6 and 1000, respectively, given the quoted units (MHz) and (km/s). This was due to a temporary error in the VLA Observing Tool that has subsequently been fixed. Because the sky frequencies are correct, and we set the rest frequency explicitly later in the deconvolution stage, this does not present a problem for the data reduction. <br />
<br />
<pre style="background-color: #E0FFFF;"><br />
Summary of Observing Strategy<br />
Gain Calibrator: J0954+1743, field id=2<br />
Bandpass Calibrator: J1229+0203, field id=5<br />
Flux Calibrator: J1331+3030 (3C286), field id=7<br />
Target: IRC+10216, field id=3<br />
Ka-band spws = 0,1<br />
</pre> <br />
<br />
[[Image:Ant_locations.png|thumb|Antenna locations from running plotants ]]<br />
Look at a graphical plot of the antenna locations and save hardcopy<br />
in case you want it later. This will be useful for picking a reference antenna --<br />
typically a good choice is an antenna close to the center of the array. Unless it <br />
shows problems after inspection of the data, we provisionally choose ea02.<br />
<br />
[[Image:elevationvstime.png|thumb|Elevation as a function of time (after selecting colorize by field).]]<br />
<source lang="python"><br />
# In CASA<br />
plotants(vis='day2_TDEM0003_10s_norx',figfile='ant_locations.png')<br />
</source><br />
<br />
Next, let's look at the elevation as a function of time for all sources. It's not the case for these data, but if the elevation is very low (usually at start or end of track) you may want to flag. Also, how near in elevation your flux calibrator is to your target will impact your ultimate absolute flux calibration accuracy. <br />
<br />
Unfortunately, the target and flux calibrator are not particularly well-matched for this observation, as you can show by plotting the elevation for each source (each sources has a different colors). We will be using data in spectral window 0, channels 4 to 60 for this plot as given by the '''spw = '0:4~60'''' parameter; the general CASA selection syntax is described in the [http://www.aoc.nrao.edu/~sbhatnag/misc/msselection/msselection.html Measurement Selection Syntax Document]:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',<br />
xaxis='time',yaxis='elevation',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60', coloraxis='field')<br />
</source><br />
<br />
Thus we are strongly dependent on the opacity and gaincurve corrections to get the flux scale right for these data. (This is something to keep in mind when planning observations!) We will deal with this after the initial inspection.<br />
<br />
[[Image:plotallfields.png|thumb|Result of plotms]]<br />
[[Image:Zoom1_mark.png|thumb|Zooming in and marking region (hatched box)]]<br />
<br />
Next, let's look at all the source amplitudes as a function of time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60', coloraxis='field')<br />
</source><br />
<br />
Now zoom in on the region very near zero amplitude for sources J0954+1743 and IRC+10216. To zoom, select the <br />
Zoom tool [[File:casaplotms-zoom.png]] in lower left corner of the {{plotms}} GUI, then you can left click to draw a box. <br />
Look for the low values (you may want to zoom a few times to really see the suspect points clearly). Now use the Mark Region [[Image:MarkRegionsButton.png]] and Locate [[File:casaplotms-locate-tool.png]] buttons (located along the bottom of the GUI) to see which antenna is causing problems. The output is be shown in the logger. Since all the "located" baselines include ea12, this is the responsible antenna.<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON PLOTMS:<br />
<br />
* When using the locate button it is important to have only selected a modest number <br />
of points with the mark region tool (see example of marked region in the thumbnail), <br />
otherwise the response will be very slow and possibly hang the tool <br />
(all of the information will be output to your terminal window, not the logger). <br />
<br />
* Throughout the tutorial, when you are done marking/locate use the Clear Regions <br />
tool to get rid of the marked box before plotting other things. <br />
<br />
* After flagdata command flagging, you have to force a complete reload of the cache <br />
to look at the same plot again with the new flags applied. To do this, either check the "force reload" box in the lower left, or do Shift+Plot.<br />
<br />
<br />
</pre> <br />
<br />
Now click the clear region [[File:casaplotms-clear-region.png]] button, and then go back to the zoom button to zoom in further to note exactly what the time range is: 03:41:00~04:10:00.<br />
<br />
Check the other sideband by changing spw to 1:4~60. You will have to<br />
re-zoom. If you have trouble, click on the Mark icon and then back to<br />
zoom. In spw 1, ea07 is bad from the beginning until after next<br />
pointing run: 03:21:40~04:10:00. To see this, compare the amplitudes when antenna is set to 'ea07' and when it is set to one of the other antennas, such as 'ea08'.<br />
<br />
If you set antenna to 'ea12' and zoom in on this initial timerange, you can also see that ea12 is bad during the same time range as for spw 0. You can also see this by entering '!ea07' for antenna, which removes ea07 from the plot (in CASA selection, "!" deselects). <br />
<br />
We can set up a flagging command to get both bad antennas for the<br />
appropriate time and spw:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='day2_TDEM0003_10s_norx',<br />
mode='list',<br />
inpfile=["field='2,3' antenna='ea12' timerange='03:41:00~04:10:00'",<br />
"field='2,3' antenna='ea07' timerange='03:21:40~04:10:00' spw='1'"])<br />
</source><br />
<br />
<br />
{{flagdata}} in mode='list' can take several commands, separated by commas. The data selection will be connected by AND for each string. <br />
<br />
Note that because the chosen timerange is limited to fields 2 and 3, the field parameter is not really<br />
needed but the above is a nice example of the task syntax.<br />
<br />
Now remove the !ea07 from antenna and replot both spw, zooming in to<br />
be sure that all obviously low points are gone. Also zoom in and<br />
check 3C286 (J1229+0203 is already obvious because it is so bright!). <br />
<br />
[[Image:IRC10216_uvdist1.png|thumb|Amplitude vs. uv-distance for IRC+10216, both spw]]<br />
<br />
Let's look more closely at IRC+10216:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0~1:4~60', coloraxis='spw')<br />
</source><br />
<br />
You can see a that there are some noisy high points. But now try:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0~1:4~60', coloraxis='spw')<br />
</source><br />
<br />
Now, we can see that most of the high points on IRC+10216 are due to large scale emission on short baselines, but there is still some noisy stuff -- for a target like this with extended emission it's best to wait until later to decide what to do about it. We will not be able to get adequate calibration for antennas that are truly bad (even if they don't stand out here) so these will be obvious later.<br />
<br />
<br />
== The Observing Log, Antenna Position Corrections, Opacities, Gaincurves, Antenna Efficiencies and other Calibration "Priors"==<br />
<br />
=== Antenna Position Corrections ===<br />
<br />
As mentioned in the observing log above, antennas ea10, ea12, and ea22 do not have good baseline positions. <br />
Antenna ea10 was not in the array, but for the other two antennas we need to check for<br />
any improved baseline positions that were derived after the observations were taken.<br />
In CASA, these corrections can derived by {{gencal}} for the JVLA. The parameter caltype='antpos' will us antenna position offset values and create a calibration table for the delay changes that this correction involves. If the 'antenna' parameter is not specified, {{gencal}} will query the Jansky VLA webpages for the offsets ([http://www.vla.nrao.edu/astro/archive/baselines/ Jansky VLA/VLA Baseline Corrections page]).<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='day2_TDEM0003_10s_norx',caltable='antpos.cal',<br />
caltype='antpos',<br />
antenna='')<br />
</source><br />
<br />
which return the antenna offsets in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea01 : 0.00000 0.00300 0.00000<br />
offsets for antenna ea02 : -0.00080 0.00000 0.00000<br />
offsets for antenna ea03 : -0.00280 0.00000 0.00000<br />
offsets for antenna ea05 : 0.00000 0.00280 0.00000<br />
offsets for antenna ea12 : -0.01000 0.00450 -0.00170<br />
offsets for antenna ea22 : -0.02570 0.00270 -0.01900<br />
offsets for antenna ea23 : -0.00140 0.00000 0.00000<br />
offsets for antenna ea24 : -0.00150 0.00000 0.00000<br />
offsets for antenna ea27 : 0.00000 0.00190 -0.00160<br />
</pre><br />
<br />
<br />
'''Please note: '''if you are reducing VLA data taken before March 1, 2010, you need to set caltype='antposvla'. For the VLA before the conversion to the Jansky VLA, the automated lookup will not work and one has to specify the the antenna positions explicitly.<br />
<br />
<br />
<br />
=== Gaincurves and Antenna Efficiencies ===<br />
<br />
<br />
The gaincurve describes how each antenna behaves as a function of elevation, for each receiver band. Currently only gaincurves for the VLA are available (see [http://www.vla.nrao.edu/astro/guides/vlbivla/current/node18.html] for the incorporated models). This option should not be used with any other telescopes. <br />
<br />
Gaincurves are generated into a separate calibration table using the task {{gencal}} with the ''caltype='gceff'. This option will also include antenna efficiencies in the resulting calibration table:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='day2_TDEM0003_10s_norx',caltable='gaincurve.cal',<br />
caltype='gceff')<br />
</source><br />
<br />
''' Note that this method replaces the ''gaincurve=T'' option in the calibrations tasks in CASA 3.4 and earlier '''<br />
<br />
=== Opacities ===<br />
<br />
The opacity of the observation can be computed from a seasonal model and/or weather station information. We are planning to have a task available for this information. At the moment, the [[CASA_EVLA_Scripts]] page hosts a script and a contributed task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, they will be recomputed for the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> in {{gaincal}}, {{applycal}}, {{bandpass}} etc. <br />
<br />
To start, we want to plot the opacity of the atmosphere at 36 GHz at the time this observation was taken so it can be corrected for in<br />
subsequent calibrations. The task '''plotweather''' takes care of that. The task plots the weather conditions at the time of the observations and calculate the atmospheric opacities basedon these data in combination with a seasonal model that contains long-term statistics at the VLA site. 'seasonal_weight=0.5' gives both equal weights: <br />
<br />
[[Image:day2_TDEM0003_10s_norx.plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
We will be running '''plotweather''' in a way that will assign the opacity list (one entry for each spw in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='day2_TDEM0003_10s_norx', doPlot=T)<br />
</source><br />
<br />
With this input, the task <br />
<br />
* returns the opacity values to the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
plotweather 0 : 36.387 : 0.039<br />
plotweather 1 : 36.305 : 0.039<br />
plotweather wrote weather figure: day2_TDEM0003_10s_norx.plotweather.png<br />
</pre> <br />
<br />
* creates a file '''"day2_TDEM0003_10s_norx.plotweather.png"''' with the elevation of the sun, the wind speed and direction, the temperature, precipitable water vapor (PWV) as functions of time over the observation (view this file with your preferred image viewer like gthumb, xv or Preview), <br />
<br />
* and assigns the myTau variable to the list of opacities per spectral window: <br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau<br />
[0.03922997791177054, 0.038993893363737792]<br />
<br />
</source><br />
<br />
We can now create a calibration table for the opacities via {{gencal}} with the ''calmode='opac' '' parameter, we can either input the opacities directly, or use the myTau variable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='day2_TDEM0003_10s_norx',caltable='opacity.cal',<br />
caltype='opac',<br />
spw='0,1',<br />
parameter=myTau)<br />
</source><br />
''' Note that this method replaces the ''opacity'' option in the calibrations tasks in CASA 3.4 and earlier '''<br />
<br />
<br />
<br />
==Set Up the Model for the Flux Calibrator==<br />
<br />
Next, we set the model for the flux calibrator. Depending on your observing frequency and angular resolution you can do this several ways. In the past, one typically used a point source (constant flux) model for <br />
the flux calibrator, possibly with a uvrange cutoff if necessary. More recently for the VLA, model images for the most common flux calibrators have been made available for use in cases where the sources are somewhat resolved. This is most likely to be true at higher frequencies and at higher resolutions (more extended arrays). <br />
<br />
Currently, CASA contains models for the most common calibrators at the most common frequencies but not yet the new Jansky VLA frequency bands S and Ka. These will be added as soon as they become available. One may check the availability of calibration models in {{setjy}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='day2_TDEM0003_10s_norx',listmodels=T)<br />
</source><br />
<br />
The terminal will now show the available models, e.g. 3C286_C.im, 3C48_K.im etc. ({{setjy}} will search in the working directory for images that may contain models, as well as in a CASA directory where known calibrator models are stored.)<br />
<br />
As mentioned above, the Ka band does not yet have a the full, final model incorporated at this time (even though there is a 3C286_A.im model available in CASA). However, models for Ka-band that are good for D, C, and B configurations are available from the [https://science.nrao.edu/facilities/vla/data-processing/models Jansky VLA calibrator model webpage for the new frequency bands]. <br />
<br />
From this page, please download the file 36.68 GHz CASA image of 3C286, this is the [http://www.aoc.nrao.edu/evlacal/3C286_36.68G.model.tgz direct link.] To do so, you may run <br />
<br />
<source lang='bash'><br />
# in a terminal, outside of CASA:<br />
wget http://www.aoc.nrao.edu/evlacal/3C286_36.68G.model.tgz<br />
tar xzvf 3C286_36.68G.model.tgz<br />
</source><br />
<br />
to create the model '''3C286_36.68G.model''' on disk.<br />
<br />
{{setjy}} scales the total flux in the model image to that appropriate for your individual spectral window frequencies according to the calibrator's flux and reports this number to the logger -- it is a good idea to save this information for your records.<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='day2_TDEM0003_10s_norx',field='7',spw='0~1',<br />
scalebychan=T,<br />
model='3C286_36.68G.model')<br />
</source><br />
<br />
The logger output for each spw is:<br />
<pre style="background-color: #fffacd;"><br />
J1331+3030 (fld ind 7) spw 0 [I=1.7764, Q=0, U=0, V=0] Jy, (Perley-Butler 2010)<br />
Using model image /Users/jott/casa/casatest/casa4.0/irc/3C286_36.68G.model<br />
Scaling spw 0's model image by channel to I = [1.7764, ..., 1.7761] Jy (ch 0) for visibility prediction.<br />
The model image's reference pixel is 1.02784e-06 arcsec from J1331+3030's phase center.<br />
Selected 2907 out of 290218 rows.<br />
J1331+3030 (fld ind 7) spw 1 [I=1.7795, Q=0, U=0, V=0] Jy, (Perley-Butler 2010)<br />
Scaling spw 1's model image by channel to I = [1.77955, ..., 1.77925] Jy (ch 0) for visibility prediction.<br />
</pre><br />
<br />
The absolute fluxes for the frequencies of all channels have now been determined, and one can proceed to the bandpass and complex gain calibrations.<br />
<br />
==Bandpass and Delay==<br />
<br />
Before determining the bandpass solution, we need to inspect phase and amplitude<br />
variations with time and frequency on the bandpass calibrator to<br />
decide how best to proceed. We limit the number of antennas to make<br />
the plot easier to see. We chose ea02 as it seems like a good<br />
candidate for the reference antenna.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='phase',correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02&ea23')<br />
</source><br />
[[Image:Nobandpass_phase.png|thumb|Phase as a function of channel for ea02.]]<br />
<br />
The phase variation is modest ~10 degrees. Now expand to all baselines that include ea02, and add an extra dimension of color:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='phase',correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
[[Image:Nobandpass_phasetime.png|thumb|Phase as a function of time for all baselines with antenna ea02.]]<br />
From this<br />
you can see that the phase variation across the bandpass is<br />
modest. Next check LL, and spw=1, both correlations. Also check<br />
other antennas if you like.<br />
<br />
Now look at the phase as a function of ''time'':<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='time',yaxis='phase',correlation='RR',<br />
avgchannel='64',spw='0:4~60',antenna='ea02&ea23')<br />
</source><br />
<br />
Expand to all antennas with ea02:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='time',yaxis='phase',correlation='RR',<br />
avgchannel='64',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
<br />
You can see that the phase variations are smooth, but do vary<br />
significantly over the 5 minutes of observation -- in most cases by<br />
a few 10s of degrees. Zoom in to see this better if you want.<br />
<br />
The conclusion from this investigation is that you need to correct<br />
the phase variations with time before solving for the bandpass to<br />
prevent decorrelation of the vector averaged bandpass<br />
solution. Since the phase variation as a function of channel is<br />
modest, you can average over several channels to increase the signal<br />
to noise of the phase vs. time solution. If the phase variation as a<br />
function of channel is larger you may need to use only a few<br />
channels to prevent introducing delay-based closure errors as can happen from averaging over<br />
non-bandpass corrected channels with large phase variations.<br />
<br />
<br />
<br />
Let's take care of the delay calibration first. The delay is the slope of phase across frequency. Form the plot we saw that it was rather modest and the bandpass calibration will certainly take care of it. Nevertheless, it might be good to derive a delay calibration first and the calculate the bandpass. The delay calibration is an antenna based calibration solution and it can be derived in {{gaincal}} with ''caltype='K' ''. <br />
<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx', caltable='delays.cal', field='5', <br />
refant='ea02', gaintype='K', gaintable=['antpos.cal','gaincurve.cal','opacity.cal'])<br />
</source><br />
<br />
We use the strong bandpass calibrator for the solution. It will be extrapolated in time to all observations.<br />
<br />
This call also exemplifies how the CASA calibration table system works. Calibration tables are incremental. So we supply the previous 'antpos.cal', 'gaincurve.cal', and 'opacity.cal' tables as input to {{gaincal}}. The following calibration step will require ''gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delay.cal']'' and so on. <br />
<br />
<br />
Now we proceed to the actual bandpass calibration: <br />
Since the bandpass calibrator is quite strong we do the phase-only<br />
solution on the integration time of 10 seconds (solint='int').<br />
<br />
<br />
[[Image:Prebp_phasecal2.png|thumb|Phase only calibration before bandpass. The 4 lines are both polarizations in both spw, unfortunately two of them get the same color green.]]<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='bpphase.gcal',<br />
field='5',spw='0~1:20~40',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal'])<br />
</source><br />
<br />
Plot the solutions (note that {{plotms}} can also be used for plotting calibration tables:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='bpphase.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-180,180])<br />
</source><br />
<br />
These solutions will appear in the CASA plotter gui. If you closed it after plotting the antennas above, it should reopen. If it is still open from before, the new plots should just appear. After you are done looking at the first set of plots, push the "Next" button on the GUI to see the next set of antennas.<br />
<br />
Now we can apply this phase solution on the fly while determining<br />
the bandpass solutions on the timescale of the bandpass calibrator scan (solint='inf'). <br />
<br />
We also use the opacity list now instead of myTau -- but both options will work.<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='day2_TDEM0003_10s_norx',caltable='bandpass.bcal',field='5',<br />
refant='ea02',solint='inf',solnorm=T,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bpphase.gcal'])<br />
</source><br />
<br />
'''A few words about solint and combine:'''<br />
<br />
The use of solint='inf' in {{bandpass}} will derive one bandpass<br />
solution for the whole J1229+0203 scan. Note that if there had been two observations of the bandpass calibrator (for example), this command would have combined the data from both scans to form one bandpass solution, because the default of the combine parameter for '''{{bandpass}}''' is combine='scan'. To solve for one bandpass for each bandpass calibrator scan you would also need to include combine='''' '''' in the bandpass call. In all calibration tasks, regardless of solint, scan boundaries are only crossed when combine='scan'. Likewise, field (spw) boundaries are only crossed if combine='field' (combine='spw'), the latter two are not generally good ideas for bandpass solutions. <br />
<br />
Plot the solutions, amplitude and phase:<br />
[[Image:Bandpass_amp.png|thumb|Amplitude Bandpass solutions]]<br />
[[Image:Bandpass-afterdelays.png|thumb|Phase Bandpass solutions]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='bandpass.bcal',xaxis='chan',yaxis='amp',<br />
iteration='antenna',subplot=331)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='bandpass.bcal',xaxis='chan',yaxis='phase',<br />
iteration='antenna',subplot=331)<br />
</source><br />
<br />
Note the scale for the phasesm, they are very small since the delays were already taken out in a previous setp.<br />
<br />
This step isn't necessary from a calibration perspective, but if you<br />
want to go ahead and check the bandpass calibration on the bandpass<br />
calibrator you can run {{applycal}} here. In the future we hope to plot<br />
corrected data on-the-fly without this {{applycal}} step. Subsequent applycals<br />
will overwrite this one, so no need to worry.<br />
<br />
[[Image:Applybandpass_phase.png|thumb|Phase as a function of channel, plotting the corrected data (after Custom and upping "Style" to 3.)]]<br />
<br />
<source lang="python"><br />
applycal(vis='day2_TDEM0003_10s_norx',field='5',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal'],<br />
gainfield=['','','','5','5'],<br />
calwt=F)<br />
</source><br />
<br />
{{applycal}} works like a matrix. The first entries in the lists are to be used together, so are the second entries etc. (except for the opacity list, which is referring to spws). All will be applied to the 'field' selection. In the above example, 'antpos.cal' from any field is applied to source '5', and the 'bandpass.cal' that was obtained for field '5' (the bandpass observation) is also applied to field '5'. Again, lists within the lists are fine. <br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='phase',ydatacolumn='corrected',<br />
correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',<br />
xaxis='channel',yaxis='amp',ydatacolumn='corrected',<br />
correlation='RR',<br />
avgtime='1e8',spw='0:4~60',antenna='ea02', coloraxis='antenna2')<br />
</source><br />
<br />
Note that the phase and amplitude as a function of channel are very flat now.<br />
<br />
==Gain Calibration==<br />
<br />
Now that we have a bandpass solution to apply, we can solve for the antenna-based phase and amplitude gain calibration. Since the phase changes on a much shorter timescale than the amplitude, we will solve for them separately. In particular, if the phase changes significantly over a scan time, the amplitude would be decorrelated, if the un-corrected phase were averaged over this timescale. Note that we re-solve for the gain solutions of the bandpass calibrator, so we can derive new solutions that are corrected for the bandpass shape. Since the bandpass calibrator will not be used again, this is not strictly necessary, but is useful to check its calibrated flux density for example. We use a minimum signal-to-noise of 2 here as it seems to be a good compromise for using good data without rejecting too many solutions (minsnr = 2). <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='intphase.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal'])<br />
</source><br />
[[Image:allcal_phaseint2.png|thumb|Plot of phase solutions on an integration time.]]<br />
<br />
Here solint='int' coupled with calmode='p' will derive a single phase solution for each 10 second integration. Note that the bandpass table is applied on-the-fly before solving for the phase solutions, however the bandpass is NOT applied to the data permanently until applycal is run later on.<br />
<br />
Note that quite a few solutions are rejected due to SNR < 2 (printed to terminal). For the most part it <br />
is only one or two solutions out of >30 so this isn't too worrying. Take note if you see large numbers of rejected solutions per integration. This is likely an indication that solint is too short for the S/N of the data.<br />
<br />
Now look at the phase solution, and note the obvious scatter within a scan time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='intphase.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-180,180])<br />
</source><br />
<br />
Although solint='int' (i.e. the integration time of 10 seconds) is the best choice to apply before for solving for the amplitude solutions, it is not a good idea to use this to apply to the target. This is because the phase-scatter within a scan can dominate the interpolation between calibrator scans. Instead, we also solve for the phase on the scan time, solint='inf' (but combine='''' '''', since we want one solution per scan) for application to the target later on. '''Unlike the bandpass task,''' for gaincal, the default of the combine parameter is combine='''' ''''.<br />
[[Image:allcal_phaseinf2.png|thumb|Plot of phase solutions on a scan time.]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='scanphase.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal'])<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='scanphase.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-180,180])<br />
</source><br />
<br />
Note that there are no failed solutions here because of the added S/N afforded by the longer solint.<br />
Alternatively, instead of making a separate phase solution for application to the target, one can also run {{smoothcal}} to smooth the solutions derived on the integration time.<br />
<br />
Next we apply the bandpass and solint='int' phase-only calibration solutions on-the-fly to derive amplitude solutions. <br />
Here the use of solint='inf', but combine='''' '''' will result in one solution per scan interval.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='amp.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='ap',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal'])<br />
</source><br />
[[Image:allcal_ampphase.png|thumb|Plot of residual phase solutions on a scan time]]<br />
<br />
Now let's look at the resulting phase solutions. Since we have taken out the phase as best we can by applying the solint='int' phase-only solution, this plot will give a good idea of the residual phase error. If you see scatter of more than a few degrees here, you should consider going back and looking for more data to flag, particularly bad timeranges etc.<br />
<br />
<source lang="python"><br />
# In CASA <br />
plotcal(caltable='amp.gcal',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[-1,-1,-20,20])<br />
</source><br />
<br />
Note that we have restricted the plot range so that all antennas are plotted with the same scale (instead of autoscaled; the "-1,-1" values for the x-axis allow autoscaling to take place still). We can see that both antenna ea12 (all times) and ea23 (first 1/3 of observation) show particularly large residual phase noise.<br />
[[Image:allcal_amp.png|thumb|Plot of amplitude solutions on a scan time]]<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='amp.gcal',xaxis='time',yaxis='amp',<br />
iteration='antenna',subplot=331,plotrange=[-1,-1,0,1])<br />
</source><br />
<br />
Note that the amplitude solutions for ea12 are very low, in particular when you set plotrange=[-1,-1,0,1]; this is another indication that this antenna is dubious.<br />
<br />
Next we use the flux calibrator (whose flux density was set in {{setjy}} above) to derive the flux of the other calibrators. Note that as of CASA 4.0 the flux table it can be written as an incremental table, just like all other calibration tables. In that case it won't replace the amp.gcal but both tables, amp.gcal as well as flux.gcal need to be carried onward. <br />
<br />
<source lang="python"><br />
# In CASA<br />
fluxscale(vis='day2_TDEM0003_10s_norx',caltable='amp.gcal',<br />
fluxtable='flux.cal',reference='7',incremental=T)<br />
</source><br />
<br />
[[Image:allcal_flux.png|thumb|Plot of flux corrected amplitude solutions.]]<br />
It is a good idea to note down for your records the derived flux densities:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Found reference field(s): J1331+3030<br />
Found transfer field(s): J0954+1743 J1229+0203<br />
Flux density for J0954+1743 in SpW=0 (freq=3.63872e+10 Hz) is: 0.224612 +/- 0.0309939 (SNR = 7.24698, N = 38)<br />
Flux density for J0954+1743 in SpW=1 (freq=3.63045e+10 Hz) is: 0.231628 +/- 0.0299344 (SNR = 7.73785, N = 38)<br />
Flux density for J1229+0203 in SpW=0 (freq=3.63872e+10 Hz) is: 27.7044 +/- 0.246888 (SNR = 112.215, N = 38)<br />
Flux density for J1229+0203 in SpW=1 (freq=3.63045e+10 Hz) is: 26.9803 +/- 0.258681 (SNR = 104.299, N = 38)<br />
</pre><br />
<br />
<!--<br />
Fitted spectral index for J0954+1743 with fitorder=1: spectral index=-12.4865 +/- 2.30427e-05<br />
Fitted spectral index for J1229+0203 with fitorder=1: spectral index=9.00262 +/- 0<br />
--><br />
<br />
<!--<br />
Next, check that the flux.cal table looks as expected:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='flux.cal',xaxis='time',yaxis='amp',<br />
iteration='antenna',subplot=331)<br />
</source><br />
<br />
Note the odd behavior for antennas ea07, ea12, and ea23.<br />
--><br />
<br />
==Applycal and Inspect==<br />
<br />
Now we apply the calibration to each source, according to which tables are appropriate, and which source should be used to do that particular calibration. For the calibrators, all bandpass solutions come from the bandpass calibrator (id=5), and the phase and amplitude calibration comes from their own solutions. <br />
<br />
'''Note:''' In all {{applycal}} steps we set calwt=F. It is very important to turn off this parameter which determines if the weights are calibrated along with the data. Data from antennas with better receiver performance and/or longer integration times should have higher weights, and it can be advantageous to factor this information into the calibration. During the VLA era, meaningful weights were available for each visibility. However, at the time of this observation, the VLA was not yet recording the information necessary to calculate meaningful weights. Since these data weights are used at the imaging stage you can get strange results from having calwt=T when the input weights are themselves not meaningful, especially for self-calibration on resolved sources (your flux calibrator and target, for example). <br />
<br />
For more recent data, the switched power information is recorded, but we currently do not recommend using this information to calculate data weights without exercising considerable caution.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the gain/phase calibrator (field '2'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='2',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the bandpass calibrator (field '5'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='5',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','5','5','5'],<br />
calwt=F)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the flux calibrator (field '7'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='7',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','intphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','7','7','7'],<br />
calwt=F)<br />
</source><br />
<br />
For the target we apply the bandpass from id=5, and the calibration from the gain calibrator (id=2):<br />
<br />
<source lang="python"><br />
# In CASA<br />
# for the target source IRC10216 (field '3'):<br />
applycal(vis='day2_TDEM0003_10s_norx',field='3',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass.bcal','scanphase.gcal','amp.gcal','flux.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
</source><br />
<br />
Now inspect the corrected data:<br />
[[Image:applycal_inspect.png|thumb|Plot of calibrated amplitudes over time.]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='5',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='', coloraxis='antenna1')<br />
</source><br />
<br />
This plot shows some data deviating from the average amplitudes. Use methods described above to <br />
mark a region for a small number of deviant data points, and click "Locate". You will find that ea12 is responsible.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='', coloraxis='antenna2')<br />
</source><br />
<br />
Here we see some problems, with high points. Mark some regions<br />
and locate in {{plotms}} to find out which antennas and in which spws. Pay special<br />
attention to antennas that have been called out already as showing some dubious behavior.<br />
<br />
What you find is that ea07 which we flagged spw=1 above, is also bad for the same timerange in spw=0. This was not obvious in the raw data, because spw=0 was adjusted in the on-line system by a gain attenuator, while spw=1 wasn't. So a lack of power on this antenna can look like very low (and obvious) amplitudes in spw=1 but not for spw=0. Looking carefully you'll see that ea07 is actually pretty noisy throughout.<br />
[[Image:ea12.png|thumb|Plot of antenna ea12 by itself]]<br />
[[Image:ea23.png|thumb|Plot of antenna ea23 by itself]]<br />
<br />
From the locate we also find that ea12 and ea23 show some high points; to see this, replot baselines using each of them alone:<br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='ea12', coloraxis='antenna2')<br />
</source><br />
<br />
<source lang="python"><br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='ea23', coloraxis='antenna2')<br />
</source><br />
<br />
It may be a a good idea to flag ea12 completely - it's just a bit noisy all around and ea23 is pretty noisy during the first scans between initial and second pointing. Recall that these are antennas we became suspicious of while inspecting the calibration solutions.<br />
<br />
[[Image:target_uvdist.png|thumb|IRC+10216 as a function of uv-distance.]]<br />
Now let's see how the target looks. Because the target has resolved structure, its best to look at it as<br />
a function of uvdistance. We'll go ahead and exclude the three antennas we already know have problems.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='!ea07;!ea12;!ea23', coloraxis='antenna2')<br />
</source><br />
<br />
The color indicates that the spikes are caused by a single antenna. Use, zoom, mark, and locate to see which one.<br />
Also look at spw=1.<br />
<br />
The bad antenna turns out to be ea28; to confirm, replot with antenna=!ea28:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='!ea07;!ea12;!ea23;!ea28', coloraxis='antenna2')<br />
</source><br />
<br />
Looks much better! To see if it's restricted to a certain time, do:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='ea28', coloraxis='antenna1')<br />
</source><br />
<br />
Baselines with ea28 clearly show issues until about two-thirds of the way through the observation. <br />
Plot another distant antenna to compare. We will go ahead and flag it all, since it's hanging far out on the north<br />
arm by itself.<br />
<br />
The additional data we've identified as bad need to be flagged, and then all the calibration steps will need to be run again.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='day2_TDEM0003_10s_norx',<br />
mode='list',<br />
inpfile=["antenna='ea07,ea12,ea28'",<br />
"antenna='ea07,ea23' timerange='03:21:40~04:10:00'"])<br />
</source><br />
<br />
==Redo Calibration after more Flagging==<br />
<br />
After flagging, you'll need to repeat the calibration steps above. Here, we append _redo to the table names to distinguish them from the first round, in case we want to compare with previous versions. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='bpphase_redo.gcal',<br />
field='5',spw='0~1:20~40',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal'])<br />
#<br />
bandpass(vis='day2_TDEM0003_10s_norx',caltable='bandpass_redo.bcal',<br />
field='5',<br />
refant='ea02',solint='inf',solnorm=T,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bpphase_redo.gcal'])<br />
#<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='intphase_redo.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='int',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal'])<br />
#<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='scanphase_redo.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='p',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal'])<br />
#<br />
gaincal(vis='day2_TDEM0003_10s_norx',caltable='amp_redo.gcal',<br />
field='2,5,7',spw='0~1:4~60',<br />
refant='ea02',calmode='ap',solint='inf',minsnr=2.0,<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal'])<br />
#<br />
fluxscale(vis='day2_TDEM0003_10s_norx',caltable='amp_redo.gcal',<br />
fluxtable='flux_redo.cal',reference='7',incremental=T)<br />
</source><br />
<br />
<pre style="background-color: #fffacd;"><br />
Flux density for J0954+1743 in SpW=0 (freq=3.63872e+10 Hz) is: 0.242404 +/- 0.0287249 (SNR = 8.43881, N = 32)<br />
Flux density for J0954+1743 in SpW=1 (freq=3.63045e+10 Hz) is: 0.233989 +/- 0.0293236 (SNR = 7.97952, N = 32)<br />
Flux density for J1229+0203 in SpW=0 (freq=3.63872e+10 Hz) is: 26.7488 +/- 0.287326 (SNR = 93.0955, N = 32)<br />
Flux density for J1229+0203 in SpW=1 (freq=3.63045e+10 Hz) is: 26.2045 +/- 0.294954 (SNR = 88.8426, N = 32)<br />
</pre><br />
Feel free to pause here and remake the calibration solution plots from above, just be sure to put in the revised table names.<br />
<br />
==Redo Applycal and Inspect==<br />
<br />
Now, apply all the new calibrations, which will overwrite the old ones. These commands are identical to those above, with the exception of the _redo part of each calibration filename.<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='day2_TDEM0003_10s_norx',field='2',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
#<br />
applycal(vis='day2_TDEM0003_10s_norx',field='5',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','5','5','5'],<br />
calwt=F)<br />
#<br />
applycal(vis='day2_TDEM0003_10s_norx',field='7',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','intphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','7','7','7'],<br />
calwt=F)<br />
#<br />
applycal(vis='day2_TDEM0003_10s_norx',field='3',<br />
gaintable=['antpos.cal','gaincurve.cal','opacity.cal','delays.cal','bandpass_redo.bcal','scanphase_redo.gcal','amp_redo.gcal','flux_redo.cal'],<br />
gainfield=['','','','5','5','2','2','2'],<br />
calwt=F)<br />
</source><br />
<br />
[[Image:gaincal_corrflag.png|thumb|Gain calibrator after further flagging and recalibration]]<br />
[[Image:target_corrflag.png|thumb|IRC+10216 after further flagging and recalibration (after selecting colorize by spw).]]<br />
<br />
Now you can inspect the calibrated data again. Except for random scatter things look pretty good.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='2',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0:4~60',antenna='', coloraxis='antenna2')<br />
</source><br />
<br />
You can use the Mark and Locate buttons to assess that the remaining scatter seems random, i.e. no particular antenna or time range appears to be responsible.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='uvdist',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='0~1:4~60',antenna='', coloraxis='spw')<br />
</source><br />
<br />
==Split==<br />
<br />
Now we split the data into individual files. This is not strictly necessary, as you can select the appropriate fields in later clean stages, but it is safer in case for example you get confused with later processing and want to fall back to this point (this is especially a good idea if you plan to do continuum subtraction or self calibration later on). It also makes smaller individual files in case you want to copy to another machine or colleague.<br />
<br />
Here, we split off the data for the phase calibrator and the target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='day2_TDEM0003_10s_norx',outputvis='J0954',<br />
field='2')<br />
#<br />
split(vis='day2_TDEM0003_10s_norx',outputvis='IRC10216',<br />
field='3')<br />
</source><br />
<br />
<!--<br />
To reinitialize the scratch columns for use by later tasks, we need to run clearcal for both new datasets<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearcal(vis='J0954')<br />
#<br />
clearcal(vis='IRC10216')<br />
</source><br />
--><br />
<br />
This concludes the calibration phase of the data reductions.<br />
<br />
== UV Continuum Subtraction and Setting Up for Self-Calibration==<br />
<br />
[[Image:irc10216_uvspec.png|thumb|UV-plot of the spectral line signal in both spw for IRC+10216.]]<br />
<br />
Now we can make a vector averaged uv-plot of the calibrated target spectral line data. It is important to note that you will only see signal in such a plot if (1) the data are well calibrated, and (2) there is significant signal near the phase center of the observations, or if the line emission (or absorption) is weak but extended. If this isn't true for your data, you won't be able to see the line signal in such a plot and will need to make an initial (dirty or lightly cleaned) line+continuum cube to determine the line-free channels. Generally, this is the recommended course for finding the line-free channels more precisely than is being done here due to time constraints, as weak line signal would not be obvious in this plot. <br />
<br />
<source lang="python"><br />
plotms(vis='IRC10216',field='',ydatacolumn='corrected',<br />
xaxis='channel',yaxis='amp',correlation='RR',<br />
avgtime='1e8',avgscan=T,spw='0~1:4~60',antenna='', coloraxis='spw')<br />
</source><br />
<br />
In the Display tab, change the Unflagged Points Symbol to Custom and Style of 3. <br />
<br />
You should see the "horned profile" typical of a rotation shell. From this plot, you can guess that strong <br />
line emission is restricted to channels 18 to 47 (zoom in if necessary to see exactly what the channel numbers are). <br />
<br />
In the Data tab, under Averaging, you can also click on "All Baselines" to average all baselines, but this is a little harder to see.<br />
<br />
Now we want to use the line free channels to create a model of the continuum emission that can be subtracted to form a line-only dataset. We want to refrain from going to close to the edges of the band -- these channels are typically noisy, and we don't want to get too close to the line channels because we could only see strong line emission in the vector averaged uv-plot.<br />
<br />
We can now either specify the line free channels via fitspw='0~1:4~13;52~63' and excludechans=F in {{uvcontsub}}, or do the inverse selection via<br />
<br />
<source lang="python"><br />
uvcontsub(vis='IRC10216',fitspw='0~1:14~51',excludechans=T,<br />
want_cont=T)<br />
</source><br />
<br />
which excludes the line channels from the continuum fit.<br />
<br />
The "want_cont=T" will produce two new datasets, IRC10216.contsub is the continuum subtracted line data, and IRC10216.cont is the continuum estimate (note however, that it is still a multi-channel dataset).<br />
<br />
==Velocity Systems and Doppler corrections==<br />
<br />
The Jansky VLA does not support Doppler tracking. Doppler setting is possible which will calculate the sky frequency based on a velocity of the source at the start of an observation. The sky frequency is then fixed throughout that track. Typically, a fixed frequency is better for the calibration of interferometric data. The downside, however, is that a spectral line may shift over one or more channels during an observation. {{clean}} takes care of such a shift when regridding the visibilities in velocity space (default is LSRK) to form an image. Sometimes, in particular when adding together different observing tracks, it may be advisable to do the regrid all data sets to the same velocity grid, combine all data to a single file, then Fourier transform and deconvolve. The tasks {{cvel}}, {{concat}}, and {{clean}} serve this purpose respectively. The following run of {{cvel}} shows an example on how the parameters of {{cvel}} may be set. <br />
<br />
The '''IRC10216.contsub''' visibility spans the following channel range (see also the listobs output in the first part of the tutorial): <br />
<br />
<source lang="python"><br />
# In CASA<br />
vishead(vis='IRC10216.contsub', mode='summary')<br />
</source><br />
<br />
<pre style="background-color: #fffacd;"><br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 Subband:0 64 TOPO 36387.229 125.000 8000.0 RR RL LR LL<br />
1 Subband:0 64 TOPO 36304.542 125.000 8000.0 RR RL LR LL<br />
</pre><br />
<br />
For spw 0, this corresponds to about 1 km/s channel width. If we want to image the HC3N spectral line with a rest frequency of 36.39232 GHz over a velocity range of -50km/s to 0km/s and a channel width of 5 km/s, we may decide to regrid the visibilities in {{cvel}} as<br />
<br />
'''Note that this step is not necessary for the processing further down in this tutorial. You may skip it if you wish.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
cvel(vis='IRC10216.contsub', outputvis='IRC10216.contsub-cveled', mode='velocity',<br />
interpolation='linear', nchan=10, start='-50km/s', width='5km/s',<br />
restfreq='36.39232GHz',outframe='LSRK', veltype='optical') <br />
</source><br />
<br />
This will create a new dataset where the data is binned into the new grid. Since all data in measurement sets are stored in frequency space, an inspection with {{vishead}} now gives:<br />
<br />
<source lang="python"><br />
# In CASA<br />
vishead(vis='IRC10216.contsub-cveled', mode='summary')<br />
</source><br />
<br />
<pre style="background-color: #fffacd;"><br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 Subband:0 10 LSRK 36392.927 606.974 6070.6 RR RL LR LL<br />
</pre><br />
<br />
After the {{cvel}} step, the data can then be combined with other observations via {{concat}} and imaged in {{clean}} with mode='channel' to conserve that velocity system and grid.<br />
<br />
Note that {{cvel}} can also Hanning smooth the data, if needed (as an alternative to the stand-alone {{hanningsmooth}} task).<br />
<br />
==Image the Spectral Line Data==<br />
<br />
Here we make images from the continuum-subtracted, calibrated spectral line data. Because the spectral line emission from IRC+10216 has significant extended emission, it is very important to run clean interactively, and make a clean mask. To make the cube a bit smaller and stay away from noisy edge channels we restrict the <br />
channel range using the spw parameter.<br />
[[Image:viewer_interactive.png|thumb|Channel 32 shown for the HC3N cube shown in the interactive viewer with the white contour showing the mask contour drawn with the polygon tool.]]<br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_HC3N.cube_r0.5',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='0:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.39232GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
interactive=T,<br />
threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
* imagermode = csclean will invoke the Cotton-Schwab cleaning algorithm and the data will be regridded into a new output velocity frame, correcting for Doppler shifts of the line during the run (VLA data for each track is always topocentric at a fixed sky frequency). The iterations are chosen as a high value to allow many clean cycles when needed. Typically, however, the threshold will kick in earlier and stop the cleaning process. <br />
<br />
It will take a little while to grid the data, but the {{viewer}} will open when it's ready to start an interactive clean. Use the "Channels tape deck" at the bottom of the Viewer display GUI to step through to the channel with the most extended (in angular size) emission, select "all channels" for the clean mask, select the polygon tool (the 'R' with the wobbly line around it) and make a single mask that applies to all channels (see example in thumbnail). Once you make the polygon region, you need to double click inside it to save the mask region -- if you see the polygon turn white you will know you succeeded. Note, that if you had the time and patience you could make a clean mask for each channel, and this would create a slightly better result. <br />
<br />
After making the mask you should check that the emission in all the other channels fits within the mask you made using the "tape deck" to move back and forth. If you need to include more area in the mask, you can chose the "erase" toggle at the top, and then encircle your existing mask with a polygon and double click inside. Then go back to "add" toggle at top and make a new mask. Alternatively, you can erase a part of the mask, or you can add to the existing mask by drawing new polygons. Feel free to experiment with this a bit.<br />
<br />
'''Note''': If you start an interactive clean, and then do not make a mask, clean will stop when you tell it to go on because it has nothing to clean. There is no default mask. <br />
<br />
To continue with {{clean}} use the "Next action" buttons in the green area on the Viewer Display GUI: The red X [[File:clean-stop.png]] will stop {{clean}} where you are, the blue arrow [[File:clean-continue.png]] will stop the interactive part of {{clean}}, but continue to clean non-interactively until reaching the stopping niter ('''note that this is "iterations" x "cycles"''') or threshold (whichever comes first), and the green arrow [[File:clean-redo.png]] will clean until it reaches the "iterations" parameter on the left side of the green area. When <br />
the interactive viewer comes back use the tape deck to recheck that your mask encompasses what you think is real emission. The middle mouse button by default controls the image stretch.<br />
<br />
Note that for this example, threshold has been set to <tt>threshold = '3mJy'</tt> to protect you from cleaning too deeply. With a careful clean mask you can clean to close to the thermal noise limit (note here I mean the actual observed rms noise limit and not the theoretical one you calculated for the proposal, as flagging, weather, etc. can affect what you actually get). It is ALWAYS best to clean each channel in a cube to a specific threshold than to stop by simply using the niter parameter, which can leave each channel cleaned to different levels. There are many ways to determine a suitable threshold. One way is to make a dirty image (<tt>niter = 0</tt>), open the cube using the viewer, go to a line free channel, select the box region tool, make a box near the field center about the size of your source, and double click inside. The rms noise of that channel will appear in the terminal window from which the {{viewer}} was launched. Try a few different boxes, average the results and this is a good estimate of the rms per channel assuming your data are not dynamic range limited (i.e. noise can be higher in channels with strong signal). This is the absolute minimum for threshold. With no mask you probably shouldn't clean deeper than 3x this rms. <br />
<br />
[[Image:SiS_interactive.png|thumb|Channel 43 shown for the SiS cube in the interactive viewer with the white contour showing the mask contour drawn with the polygon tool.]]<br />
<br />
Keep cleaning, by using the green Next Action arrow [[File:clean-redo.png]] until the residual displayed in the viewer looks "noise like". To speed things up, you might change the iteration parameter in the viewer to something like 300. This parameter can also be set in the task command. You will notice that in this particular case, there are residuals that cannot be cleaned -- these are due to the extended resolved out structure on size scales larger than the array is sensitive to (the "Largest Angular Scale" or LAS that the array is sensitive to can be calculated from the shortest baseline length), and potential residual phase and amplitude calibration errors. We will explore this in a few sections with self-calibration. <br />
<br />
Repeat the process for the SiS line using the call below, note that the emission for this line is less extended than the HC3N -- this has to do with the different excitation requirements of the two different lines. The SiS is excited closer to the central star than the HC3N.<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_SiS.cube_r0.5',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='1:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.30963GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
interactive=T, <br />
threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
You can look at both cubes using the viewer, and the tape deck to play the cube as a "movie".<br />
<source lang="python"><br />
# In CASA<br />
viewer<br />
</source><br />
<br />
==Image the Continuum data==<br />
<br />
Below the use of mode='mfs' will make a single multi-frequency synthesis image out of the specified spw/channels. Again you should make an interactive clean mask. Since no threshold is set, you will need to stop cleaning when the residual looks noise like using the red x "Next Action" button (it will be done when the viewer comes back the second time). The continuum for IRC10216 is very weak but interesting -- it is essentially tracing the photosphere of the AGB star. <br />
<br />
The continuum data set produced with wantcont=True in uvcontsub2 is the model fit. To image the continuum itself, use the line-free channels.<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216',imagename='IRC10216.36GHzcont',<br />
mode='mfs',imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='0~1:5~14,0~1:48~59',<br />
weighting='briggs',robust=0.5,<br />
interactive=T)<br />
</source><br />
<br />
Now look at the result in the viewer, if you like:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer<br />
</source><br />
<br />
==Image Analysis and Viewing==<br />
<br />
Next make integrated intensity maps (moment 0) and intensity-weighted velocity maps (moment 1). For HC3N, we also produce a velocity dispersion, peak flux, and median map. All are derived with {{immoments}}. To do this, we'll want to know what channels the line emission starts and ends on, and also the rms noise in a single channel. So first lets open the viewer:<br />
<br />
<source lang="python"><br />
# In CASA <br />
viewer<br />
</source><br />
<br />
Then use the Viewer tape deck to see which channels have significant line emission. For HC3N, the line channel range in the cube is 16 to 45, and it is the same for SiS. <br />
<br />
[[Image:irc10216.jpg|thumb|HC3N moment 0 map with white continuum contours superposed.]]<br />
[[Image:irc10216_sismom0.jpg|thumb|SiS moment 0 map with white continuum contours superposed.]]<br />
<br />
Then use the tape deck to go to a line free channel, select the box region tool and make a box. When you double click in the box, the image statistics for the channel you are on will print to the terminal. Move the box around a bit to see what the variation in rms noise is. You should get something like 2 mJy. Note that the rms is much worse in channels with strong emission because of the low dynamic range of these data. If you want the box tool to go away (i.e. if you want to make a new one), hit the escape key. <br />
<br />
Now let's make the moment 0 and moment 1 maps. For moment zero, it's best to limit the calculation to image channels with significant signal in them, but not to apply a flux cutoff, as this will bias the derived integrated intensities upward.<br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_HC3N.cube_r0.5.image',moments=[0],<br />
axis='spectral',<br />
chans='16~45',<br />
outfile='IRC10216_HC3N.cube_r0.5.image.mom0')<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_SiS.cube_r0.5.image',moments=[0],<br />
axis='spectral',<br />
chans='16~45',<br />
outfile='IRC10216_SiS.cube_r0.5.image.mom0')<br />
</source><br />
<br />
To have a look at these, use the viewer:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('IRC10216_HC3N.cube_r0.5.image.mom0')<br />
#<br />
viewer('IRC10216_SiS.cube_r0.5.image.mom0')<br />
</source><br />
<br />
For moment 1, it is essential to apply a conservative flux cutoff to limit the calculation to high signal-to-noise areas. Here we use about 5&sigma;:<br />
<br />
[[Image:irc10216_dust_HC3N_cont.png|thumb|The VLT V-band image from Le&atilde;o et al. (2006, A&A, 455,187) showing dust rings, overlaid with white HC3N moment 0 contours and black 36 GHz continuum contours.]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_HC3N.cube_r0.5.image',moments=[1],<br />
axis='spectral',<br />
chans='16~46',excludepix=[-100,0.01],<br />
outfile='IRC10216_HC3N.cube_r0.5.image.mom1')<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_SiS.cube_r0.5.image',moments=[1],<br />
axis='spectral',<br />
chans='16~45',excludepix=[-100,0.01],<br />
outfile='IRC10216_SiS.cube_r0.5.image.mom1')<br />
</source><br />
<br />
Finally, we will do velocity dispersion, peak flux, and median map in a single step for HC3N. {{immoments}} can perform these steps even though the latter two are not 'moments' in a mathematical sense. Check the help file to find out the options. Peak flux and median are produced with the moment parameter set to 8 and 3:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immoments(imagename='IRC10216_HC3N.cube_r0.5.image',moments=[2,8,3],<br />
axis='spectral',<br />
chans='16~46',excludepix=[-100,0.01],<br />
outfile='IRC10216_HC3N.cube_r0.5.image.extramoms')<br />
</source><br />
<br />
will create the files IRC10216_HC3N.cube_r0.5.image.extramoms.weighted_dispersion_coord, IRC10216_HC3N.cube_r0.5.image.extramoms.median, and IRC10216_HC3N.cube_r0.5.image.extramoms.maximum.<br />
<br />
Now use the viewer to further explore the images you've made.<br />
<br />
For fun you can download the VLT V-band image at http://casa.nrao.edu/Data/EVLA/IRC10216/irc_fors1_dec_header.fits kindly provided by <br />
Izan Le&atilde;o and overlay the moment images and 36 GHz continuum. More information about the dust properties can be found in the Le&atilde;o et al. (2006) paper http://adsabs.harvard.edu/abs/2006A%26A...455..187L.<br />
<br />
The creation of position velocity cuts from the viewer is currently being developed and hopefully available soon in CASA. If you are interested in a work-around, you may have a look at the [[How_to_rotate_and_slice_a_cube_for_pV_diagrams|pV casaguide]]. Masking the data cube to extract the emission is described [[Masking_images_for_analysis|here]].<br />
<br />
== Spectrum Fitting ==<br />
<br />
Frequently, one would like to fit Gaussians or polynomials to the spectral line in the data cube. This can be done with CASA's {{specfit}} task. {{specfit}} can fit those functions to an average spectrum define by some bounding box, or, alternatively, for each pixel. In the following, we will do both.<br />
<br />
=== Fitting an average spectrum ===<br />
<br />
[[Image:viewer-irc-specfit1.png|thumb|The viewer showing the cube at plane 34. The green box marks the region that is averaged for the spectral profile. ]]<br />
<br />
[[Image:viewer-irc-specfit1-profile.png|thumb|Spectral profile of the HC3N line within the green rectangle.]]<br />
<br />
First, we want to inspect the spectrum. Load the image into the viewer (here: the HC3N image cube), select '''"spectral profile"''' from the '''Tools''' menu and open a region with the mouse button that is assigned to the rectangular '''"R"''' region in the tool bar. Best to do this at a plane that shows the entire extent of the source. The average spectrum will be displayed in a separate panel.<br />
<br />
To fit this profile in {{specfit}}, we need a region file outlining the 2-D region that is averaged (the green box in the viewer screenshot).<br />
In the following we use the new CASA region format (CASA 3.3 and higher) that is described [[CASA Region Format | here]]. Following the guidelines on that page, we create a file named '''specfit.crtf''' that describes a box with its [[x1,y1],[x2,y2]] corners in J2000 RA DEC coordinates.<br />
<br />
<pre style="background-color: #fffacd;"><br />
#CRTFv0<br />
box[[09:47:59.2, 13.16.24], [09:47:55.8, 13.17.09]]<br />
</pre><br />
<br />
We will fit 2 Gaussians to the two peaks of the spectrum (the scientific merit is debatable). A file with initial values for the fit can be provided via the '''estimates''' parameter - see {{specfit}} for details. Here we will let CASA figure out the start values by itself: <br />
<br />
<source lang="python"><br />
# In CASA<br />
myfit = specfit(imagename='IRC10216_HC3N.cube_r0.5.image', region='specfit.crtf', multifit=F,<br />
estimates='', ngauss=2) <br />
<br />
</source><br />
<br />
Note that the output is stored in a Python dictionary called "myfit", as well as printed to the CASA logger. You should get something similar to this (depending on the details of flagging etc.):<br />
<br />
<pre style="background-color: #fffacd;"><br />
Fit :<br />
RA : 09:47:57.505<br />
Dec : +13.16.46.460<br />
Stokes : I<br />
Pixel : [145.502, 164.499, 0.000, *]<br />
Attempted : YES<br />
Converged : YES<br />
Iterations : 23<br />
Valid : YES<br />
Results for component 0: <br />
Type : GAUSSIAN<br />
Peak : 5.63 +/- 0.43 mJy/beam<br />
Center : -16.08 +/- 0.33 km/s<br />
40.66 +/- 0.32 pixel<br />
7.74 +/- 0.76 pixel<br />
Integral : 47.7 +/- 6.0 mJy/beam.km/s<br />
Results for component 1:<br />
Type : GAUSSIAN<br />
Peak : 4.36 +/- 0.33 mJy/beam<br />
Center : -33.73 +/- 0.56 km/s<br />
23.53 +/- 0.54 pixel<br />
FWHM : 14.5 +/- 1.4 km/s<br />
14.1 +/- 1.4 pixel<br />
Integral : 67.5 +/- 8.4 mJy/beam.km/s<br />
</pre><br />
<br />
which seems to have caught the two peaks pretty well.<br />
<br />
<!--<br />
=== Spectral Fitting pixel by pixel ===<br />
<br />
[[Image:irc-amp0.png|thumb|Output image of {{specfit}} of the amplitude of the first Gaussian component.]]<br />
<br />
{{specfit}} can also fit Gaussians to every spectrum in each single spatial pixel. The following command will do this within the '''spectfit.crtf''' region defined above:<br />
<br />
<source lang="python"><br />
# In CASA<br />
pixfit = specfit(imagename='IRC10216_HC3N.cube_r0.5.image', region='specfit.crtf', ngauss=2,<br />
multifit=T, amp='fit-amp.image', center='fit-center.image', fwhm='fit-fwhm.image')<br />
</source><br />
<br />
In this example, {{specfit}} will produce three images per Gaussian, images that map the best fit values of the Gauss peaks (amplitudes), velocity centers, and full widths at half maximum. For the first Gaussian, the image to the right displays the amplitude image '''fit.amp.image_0'''.<br />
<br />
--><br />
<br />
== Self-Calibration ==<br />
<br />
The many different aspects of self-calibration could fill several casaguides. Here we describe a simple process for this particular relatively low S/N data (low S/N per channel, at least).<br />
<br />
While running {{clean}} above, the model column for each channel will have been filled with the clean model (if you made a Fourier transform of this model, you would see an image of the clean components). <br />
<br />
We choose to do the self cal on the spw=1 SiS line data because it has the strongest emission in a single channel and is a bit more compact than the HC3N data. We will run {{gaincal}} specifying the channel in the uv-data that has the brightest peak in the image (use the {{viewer}} to figure out which channel this is for spw=1), note down what the peak flux is. Since we started the image with a channel range we need to account for the fact that the image channel numbers do not map exactly to the uv-data channel numbers (they are off by 5 so that channel 13 in the image is roughly channel 19 in the uv-data). <br />
<br />
The next thing we need to understand is the S/N of the data. In particular, to self-cal, you need enough signal on a single baseline over the course of your chosen solint to get a S/N of about 3. Above we calculated an average rms noise of about 2 mJy/beam/channel for the whole timerange (about 95 minutes on source time) and all antennas (16). We can use our knowledge of the radiometer equation (see [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary_-_Current#Sensitivity VLA Sensitivity]) where rms scales as 1/sqrt(time * #baselines), and the number of baselines= N(N-1)/2 and N=# of antennas. So the rms noise on one baseline, for one 10 second integration in this observation is given by:<br />
<br />
<math> {\rm RMS(baseline)} = {\rm 2\ mJy\ beam^{-1}\ channel^{-1}} \sqrt{ \frac{95\times 60\ {\rm sec}}{10\ {\rm sec}}\times\frac{16\times 15}{2\times 1}}\ {\sim}\ 500\ {\rm mJy\ beam^{-1}\ channel^{-1}}</math><br />
<br />
[[Image:timeonsource.png|thumb|Plot to estimate the time on source.]]<br />
<br />
The 95 minutes of on-source time can be estimated from a plot like this where you can sum up the amount of time on a source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='day2_TDEM0003_10s_norx',field='3',ydatacolumn='corrected',<br />
xaxis='time',yaxis='amp',correlation='RR,LL',<br />
avgchannel='64',spw='1:4~60',antenna='')<br />
</source><br />
<br />
This analysis suggests that the rms noise on one baseline, for one 10 second integration is only about 500 mJy. In contrast, the peak flux density in the strongest SiS channel is only about 200 mJy (you can check using the {{viewer}}). Since the emission is fairly compact, most baselines will see about this peak flux; this is why we choose the more compact of the two possible lines. Thus, a 10 second solution interval is not enough to get a SNR of at least 3 on a 200 mJy peak. We need to use a solint large enough so that the rms noise is not worse than about 1/3 of 200 mJy. Thus, a solint of 10 minutes is about the shortest we can use and be reasonably confident of the solutions. <br />
<br />
Now we run {{gaincal}} with the solint we have determined. Note that because our desired solint is more <br />
than the scan time, we need to include combine='scan'.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='IRC10216.contsub',caltable='pcal_ch19one_10min',<br />
spw='1:19',calmode='p',solint='10min',combine='scan',<br />
refant='ea02',minsnr=3.0)<br />
</source><br />
<br />
[[Image:selfcalone.png|thumb|Phase-only self-calibration solutions with 10 minute solint (second page of the display). ]]<br />
Now let's look at the solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='pcal_ch19one_10min',xaxis='time',yaxis='phase',<br />
iteration='antenna',subplot=331,plotrange=[0,0,-50,50])<br />
</source><br />
<br />
For some antennas you can see clear global trends away from zero: ea08, ea21, and ea24 are examples, and you can also see some smaller variations with time.<br />
<br />
Now let's explore whether applying this solution actually improves matters. To do this we need to run {{applycal}} to apply the solutions to the line dataset, both spw. We need to use spwmap to tell it that the solutions derived for spw=1 should be applied to both spw=0 and spw=1. Again it's important to set calwt=F here.<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='IRC10216.contsub',field='',spw='0,1',<br />
gaintable=['pcal_ch19one_10min'],spwmap=[[1,1]],calwt=F)<br />
</source><br />
<br />
'''Note:''' in this example we ran the self-cal steps on the full uv continuum subtracted spectral line data set. For a more complex iterative self-calibration proceedure, you may find it easier to split off the channel/spw you want to experiment on with {{split}}, and then do all the imaging ({{clean}}) and {{gaincal}} steps with it. The {{gaincal}} tables created on the single channel can still be applied with {{applycal}} to the multi-channel/spw dataset. If you do this though, keep in mind that once split, the single-channel data will have its spw id reset to 0 (you can check with {{listobs}}), no matter what spw it came from. Thus in order to applycal with it you would need <nowiki>spwmap=[[0,0]]</nowiki>.<br />
<br />
To save time we can use the clean mask we made before and run in a non-interactive mode. You can use a mask over again as long as the number of channels in the {{clean}} call haven't changed. You can change cell or imsize and it will still do the right thing.<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_HC3N.cube_r0.5.pselfcal',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='0:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.39232GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
mask='IRC10216_HC3N.cube_r0.5.mask',<br />
interactive=F,threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='IRC10216.contsub',imagename='IRC10216_SiS.cube_r0.5.pselfcal',<br />
imagermode='csclean',<br />
imsize=300,cell=['0.4arcsec'],spw='1:5~58',<br />
mode='velocity',interpolation='linear',<br />
restfreq='36.30963GHz',outframe='LSRK',<br />
weighting='briggs',robust=0.5,<br />
mask='IRC10216_SiS.cube_r0.5.mask', <br />
interactive=F,threshold='3.0mJy',niter=100000)<br />
</source><br />
<br />
Now investigate the original and self-cal'ed images in the viewer. You will find that even this single self-cal step significantly improves the images. Try opening both versions of the SiS image cubes. <br />
Then select a bright channel from the tape deck, then use the "wrench" and "pwrench" guis to make a plot like below setting the same image range for both cubes, and two panels in x, then to see both images of that channel side-by-side click the blink toggle (see image below for more tips on setup.)<br />
<br />
[[Image:compareselfcal.png|600px|Original and self-cal SiS images for channel 37, notice the decrease in <br />
residuals.]]<br />
<br />
Repeat for HC3N:<br />
<br />
[[Image:compareselfcal2.png|600px|Original and self-cal HC3N images for channel 13, notice the decrease in <br />
residuals.]]<br />
<br />
Now you can redo the moment images if you like with the improved cubes (be sure to change the output file). names. <br />
<br />
<br />
[[Main Page | &#8629; '''CASAguides''']]<br />
<br />
--[[User:Cbrogan|Crystal Brogan]] <br />
--additions:[[User:Jott| Juergen Ott]], [[User:Mkrauss| Miriam Krauss]], [[User:Dshepher| Deb Shepherd]]<br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15618EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T18:28:07Z<p>Knyland: /* Multi-scale, multi-frequency, wide-field clean */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'RR,LL')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15617EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T18:25:48Z<p>Knyland: /* Imaging */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'RR,LL')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15616EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T18:25:03Z<p>Knyland: /* Splitting out data for G55.7+3.4 */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'RR,LL')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15615EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T18:23:35Z<p>Knyland: /* Plotting calibrated data */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15614EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T18:10:10Z<p>Knyland: /* Flux scaling the gain solutions */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 (freq=1.256e+09 Hz) is: 1.46134 +/- 0.0285103 (SNR = 51.2565, N = 40)<br />
Flux density for J1925+2106 in SpW=3 (freq=1.384e+09 Hz) is: 1.53204 +/- 0.0250103 (SNR = 61.2564, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 (freq=1.648e+09 Hz) is: 1.69831 +/- 0.0249004 (SNR = 68.2043, N = 40)<br />
Flux density for J1925+2106 in SpW=6 (freq=1.776e+09 Hz) is: 1.75193 +/- 0.026547 (SNR = 65.9934, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60663 +/- 0.00468693 (freq=1.50187 GHz) spidx=0.538695 +/- 0.021959<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15613EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T18:07:43Z<p>Knyland: /* Flux scaling the gain solutions */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3', incremental=False)<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192&diff=15612EVLA 3-bit Tutorial G1922014-02-10T17:56:35Z<p>Knyland: /* Final phase and amplitude calibration */</p>
<hr />
<div>This is an Advanced EVLA data reduction tutorial that calibrates and images a 6-cm wide-band continuum dataset.<br />
<br />
<b>This casaguide is for Version 4.2.0 of CASA.</b><br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of a single-pointing 6-cm EVLA wideband continuum dataset of the galaxy NGC2967 (UGC5180) which was the location of the supernova candidate SN2010FZ. No supernova was detected in this observation, but the galactic continuum emission from this face-on spiral is nicely imaged. The data were taken in with 1024 MHz of bandwidth in each of two widely spaced basebands (each comprised of 8 128-MHz spectral windows), spanning 4.5 to 7.5 GHz. We will use wideband imaging techniques in this tutorial.<br />
<br />
This is a more advanced tutorial, and if you are a relative novice (and <em>particularly</em> for EVLA continuum calibration and imaging), it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before tackling this dataset. We will not include basic information on CASA processing in this tutorial.<br />
<br />
From the [http://casaguides.nrao.edu MainPage] of this guide you can find helpful information:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g. as lists for flags) outside the function call so make sure you<br />
set those before running the task command. Note that when you call a CASA task as a function the task parameters you<br />
do not set in the function call (assuming there is at least one) will be set to their defaults, and will not use values<br />
you set in previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more <br />
on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult,<br />
go ahead and widen the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the EVLA under program AS1015 as the scheduling block (SB) <tt>AS1015_sb1658169_1.55388.89474846065</tt>, and was run on 2010-07-11 from 21:28 to 22:28 UT (size 37.74GB). <br />
<br />
The data can be directly downloaded from [http://casa.nrao.edu/Data/EVLA/SN2010FZ/SN2010FZ_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/SN2010FZ/SN2010FZ_10s.ms.tar.gz] (dataset size: 2.9 GB). For example, in you Linux terminal:<br />
<br />
<source lang="bash"><br />
wget http://casa.nrao.edu/Data/EVLA/SN2010FZ/SN2010FZ_10s.ms.tar.gz<br />
</source><br />
<br />
Your first step will be to unzip and untar the file in a terminal, before you start CASA:<br />
<br />
<source lang="bash"><br />
tar -xzvf SN2010FZ_10s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data straight from the EVLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for project **AS1015**. Then select the <tt>AS1015_sb1658169_1.55388.89474846065</tt> dataset and choose to apply the online flags (check box "Apply flags generated during observing") and time-averaging of 10 seconds. (The data were taken in D-configuration [max baselines 1km], so one can safely average to 3s or even 10s to reduce dataset size.) Also select the tar option. This will create a file equivalent to what is used at the workshop.<br />
<br />
== Starting CASA ==<br />
<br />
{{CaltechCASAStartup}}<br />
<br />
== Examining the MS ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('SN2010FZ_10s.ms')<br />
</source><br />
<br />
In the logger you should see:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
<br />
================================================================================<br />
MeasurementSet Name: SN2010FZ_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Alicia M. Soderberg Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 1570726 Total integration time = 3359 seconds<br />
Observed from 11-Jul-2010/21:30:44.0 to 11-Jul-2010/22:26:43.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
11-Jul-2010/21:30:44.0 - 21:30:52.0 2 0 J0925+0019 404 6.43 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:31:02.0 - 21:32:22.0 3 0 J0925+0019 5062 9.68 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:32:32.0 - 21:33:52.0 4 0 J0925+0019 6277 9.91 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:34:02.0 - 21:34:52.0 5 0 J0925+0019 4148 9.96 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:35:02.0 - 21:35:51.5 6 0 J0925+0019 32640 9.44 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
21:36:01.0 - 21:38:20.5 7 0 J0925+0019 81600 9.93 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
21:38:44.0 - 21:39:51.0 9 1 SN2010FZ 43520 9.16 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:40:01.0 - 21:41:20.5 10 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:41:30.0 - 21:42:50.0 11 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:43:00.0 - 21:44:20.0 12 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:44:30.0 - 21:45:50.0 13 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:46:00.0 - 21:47:19.5 14 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:47:29.0 - 21:47:49.0 15 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:48:12.0 - 21:49:18.5 16 0 J0925+0019 43520 9 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
21:49:42.0 - 21:50:49.0 17 1 SN2010FZ 43520 9.17 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:50:59.0 - 21:52:19.0 18 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:52:29.0 - 21:53:48.5 19 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:53:58.0 - 21:55:18.0 20 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:55:28.0 - 21:56:48.0 21 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:56:58.0 - 21:58:18.0 22 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:58:28.0 - 21:58:47.5 23 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:59:10.5 - 22:00:17.0 24 0 J0925+0019 43520 8.99 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
22:00:39.5 - 22:01:47.0 25 1 SN2010FZ 43520 9.18 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:01:57.0 - 22:03:17.0 26 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:03:27.0 - 22:04:47.0 27 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:04:57.0 - 22:06:16.5 28 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:06:26.0 - 22:07:46.0 29 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:07:56.0 - 22:09:16.0 30 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:09:26.0 - 22:09:45.5 31 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:10:08.0 - 22:11:15.5 32 0 J0925+0019 43520 9.13 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
22:11:38.0 - 22:12:45.5 33 1 SN2010FZ 43520 9.19 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:12:55.0 - 22:14:15.0 34 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:14:25.0 - 22:15:45.0 35 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:15:55.0 - 22:17:15.0 36 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:17:25.0 - 22:18:44.5 37 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:18:54.0 - 22:20:14.0 38 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:20:24.0 - 22:20:43.5 39 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:21:06.0 - 22:22:13.5 40 0 J0925+0019 42690 9.15 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
22:25:13.0 - 22:25:13.0 42 2 3C286 1028 2.87 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
22:25:23.0 - 22:26:43.0 43 2 3C286 47757 9.6 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
(nVis = Total number of time/baseline visibilities per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nVis <br />
0 D J0925+0019 09:25:07.81503 +00.19.13.9334 J2000 0 303381 <br />
1 NONE SN2010FZ 09:42:04.77000 +00.19.51.0000 J2000 1 1218560<br />
2 K 3C286 13:31:08.28798 +30.30.32.9589 J2000 2 48785 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (18 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 7686 2000 128000 RR RL LR LL <br />
1 64 TOPO 7836 2000 128000 RR RL LR LL <br />
2 64 TOPO 4488 2000 128000 RR RL LR LL <br />
3 64 TOPO 4616 2000 128000 RR RL LR LL <br />
4 64 TOPO 4744 2000 128000 RR RL LR LL <br />
5 64 TOPO 4872 2000 128000 RR RL LR LL <br />
6 64 TOPO 5000 2000 128000 RR RL LR LL <br />
7 64 TOPO 5128 2000 128000 RR RL LR LL <br />
8 64 TOPO 5256 2000 128000 RR RL LR LL <br />
9 64 TOPO 5384 2000 128000 RR RL LR LL <br />
10 64 TOPO 6488 2000 128000 RR RL LR LL <br />
11 64 TOPO 6616 2000 128000 RR RL LR LL <br />
12 64 TOPO 6744 2000 128000 RR RL LR LL <br />
13 64 TOPO 6872 2000 128000 RR RL LR LL <br />
14 64 TOPO 7000 2000 128000 RR RL LR LL <br />
15 64 TOPO 7128 2000 128000 RR RL LR LL <br />
16 64 TOPO 7256 2000 128000 RR RL LR LL <br />
17 64 TOPO 7384 2000 128000 RR RL LR LL <br />
Sources: 50<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 J0925+0019 0 - - <br />
0 J0925+0019 1 - - <br />
0 J0925+0019 2 - - <br />
0 J0925+0019 3 - - <br />
0 J0925+0019 4 - - <br />
0 J0925+0019 5 - - <br />
0 J0925+0019 6 - - <br />
0 J0925+0019 7 - - <br />
0 J0925+0019 8 - - <br />
0 J0925+0019 9 - - <br />
0 J0925+0019 10 - - <br />
0 J0925+0019 11 - - <br />
0 J0925+0019 12 - - <br />
0 J0925+0019 13 - - <br />
0 J0925+0019 14 - - <br />
0 J0925+0019 15 - - <br />
0 J0925+0019 16 - - <br />
0 J0925+0019 17 - - <br />
1 SN2010FZ 2 - - <br />
1 SN2010FZ 3 - - <br />
1 SN2010FZ 4 - - <br />
1 SN2010FZ 5 - - <br />
1 SN2010FZ 6 - - <br />
1 SN2010FZ 7 - - <br />
1 SN2010FZ 8 - - <br />
1 SN2010FZ 9 - - <br />
1 SN2010FZ 10 - - <br />
1 SN2010FZ 11 - - <br />
1 SN2010FZ 12 - - <br />
1 SN2010FZ 13 - - <br />
1 SN2010FZ 14 - - <br />
1 SN2010FZ 15 - - <br />
1 SN2010FZ 16 - - <br />
1 SN2010FZ 17 - - <br />
2 3C286 2 - - <br />
2 3C286 3 - - <br />
2 3C286 4 - - <br />
2 3C286 5 - - <br />
2 3C286 6 - - <br />
2 3C286 7 - - <br />
2 3C286 8 - - <br />
2 3C286 9 - - <br />
2 3C286 10 - - <br />
2 3C286 11 - - <br />
2 3C286 12 - - <br />
2 3C286 13 - - <br />
2 3C286 14 - - <br />
2 3C286 15 - - <br />
2 3C286 16 - - <br />
2 3C286 17 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
7 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
8 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
9 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
10 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
11 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
12 ea14 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA, for a total integration of 3359 seconds (1 hour). The number of data records (1570726) is equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 351 baselines (27X26/2) X 360 integrations (3600s total/10s avg) X 16 spectral windows = 2021760. Note that this is high by ~30%; this is because the archive already flagged bad data, and there are some scans which only have two (rather than 16) spectral windows present. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. <br />
<br />
From the spectral window information, we can see that there were a total of 18 (0 through 17) spectral windows in this dataset. The first two of these (0 and 1) were only used to help set up the correlator. <br />
<br />
Looking at the scan listing, we can see that the first four scans which are present used only these spectral windows. These are referred to as "dummy scans". We will not be using these, since they often contain bad data. <br />
<br />
The C-band data of interest is contained in scans 6-44 and spectral windows 2 to 17. Careful examination shows that scan 8 is missing but from the time ranges that the data has been merged into scan 7. This sort of correlator back-end data-capture issue was occasionally seen during 2010. Hopefully, it will not affect our data, but we should keep an eye out for problems with scan 7. <br />
<br />
The field listing shows three sources: <br />
<br />
* J0925+0019 (also referred to by its field ID, 0), which will serve as a calibrator for the visibility phases, <br />
* SN2010FZ (1), our science target field, and <br />
* 3C286 (2), which will serve as a calibrator for the visibility amplitudes, i.e., it is assumed to have a precisely known flux density; as well as the spectral bandpass.<br />
<br />
== Flagging the MS ==<br />
<br />
The online flags, which are a record of known bad data produced by the EVLA online system, have already been applied by the archive as it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is also stored in a separate table in the MS, called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>SN2010FZ_10s.ms</tt>.)<br />
<br />
[[Image:PlotSN2010FZ_flagcmd_3.4.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}.<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='SN2010FZ_10s.ms',inpmode='table',action='list')<br />
</source><br />
These will go to the logger or terminal (they appear to go to the terminal now in 4.2).<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(285)<br />
flagcmd(vis='SN2010FZ_10s.ms',inpmode='table',action='plot',tablerows=myrows)<br />
</source><br />
<br />
Note that we are only plotting the first 285 rows -- this is because the last few are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. Note that you can not do the <tt>tablerows</tt> selection and plot those too, you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
This will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='SN2010FZ_10s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
plotfile='PlotSN2010FZ_flagcmd_4.2.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. <br />
They are color-coded by REASON, and you see ANTENNA_NOT_ON_SOURCE flags between scans, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after band changes when the subreflector rotates to <br />
pick up the new feed on the ring, some are slower than others). What you watch for here are long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags.<br />
<br />
[[Image:plotSN2010FZ_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('SN2010FZ_10s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs.X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of plotms.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting so most box/flag operations would not get rid of all the bad data. <br />
<br />
We will instead use plotms to identify bad data and then use flagcmd to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imaging spending a day flagging your data, then a disk error corrupts the MS. It's imperative that you have an automated way to regenerate your work. This is also why we encourage you to keep a running file with all the commands you use on a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that gets rid of boxes you have drawn. Be careful and don't hit the '''Flag''' button by mistake!<br />
<br />
As we found above, the useful spectral windows are 2-17. To get an idea of the data layout, plot a single baseline (ea01&ea02) and channel (31, for all spectral windows) versus time:<br />
<br />
[[Image:screenshotPlotSN2010FZ_plotms_ants1_4.0.png|200px|thumb|right|plotms ea01&ea02 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='',spw='2~17:31~31', \<br />
antenna='ea01&ea02',correlation='RR,LL',xaxis='time',yaxis='amp')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) flux calibrator at the end of the observation. Feel free to play with ways to view, or color the data: for example, go to the "Display" left-hand tab, and choose "Colorize by: Field". You can also change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style".<br />
<br />
[[Image:screenshotPlotSN2010FZ_plotms_ants2_4.0.png|200px|thumb|right|plotms ea01 for field 2 showing amp versus ANTENNA2]]<br />
Look for bad antennas by picking the last field and plotting baselines versus antenna <tt>ea01</tt>:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17:31~31', \<br />
antenna='ea01',correlation='RR,LL',xaxis='antenna2',yaxis='amp')<br />
</source><br />
<br />
You should be able to see that antenna 11 (= ea13) is bad (very low amplitude, it has no C-band receiver!) and that some of the spectral windows on 15 and 23 (ea17, ea25) are also on the low side. Boxing with the '''Mark Regions''' [[Image:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that spw 10-17 are suspect for these antennas. (Note: you may also leave these in for now if you like; if this were truly a first pass through the data it is unlikely that they would be caught. Since this is a tutorial, and there is limited time for a second pass through the data, it's probably best to trust us and delete them now.)<br />
<br />
[[Image:plotSN2010FZ_plotms_ea02.png|200px|thumb|right|plotms field 2 ea02 amp vs frequency]]<br />
Now look at the bandpass for ea02 - it is in the inner core and a prospective reference antenna. Exclude ea13 using negation (represented by "!") in the selection:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17', \<br />
antenna='ea02;!ea13',correlation='RR,LL',xaxis='frequency',yaxis='amp')<br />
</source><br />
There is clearly less data for spw 11, and use of Locate shows spw 11 data only for ea02,ea03,04,08,09,11,12. We will later delete this incomplete spw. Note also the very strong RFI spike at 6614 MHz (spw 10 ch 63) with clear ringing contaminating both spw 10 and 11. There is also a tremendous roll-off in spw 10. We will drop these spectral window when we process the data.<br />
<br />
[[Image:plotSN2010FZ_plotms_ea02ea20.png|200px|thumb|right|plotms ea02 iteration with baseline stopped at ea02&ea20 showing phase vs frequency]]<br />
We can also step through the baselines to our antenna using iteraxis:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',iteraxis='baseline')<br />
</source><br />
and use the '''Next Iteration''' [[Image:NextIterationButton.png]] button to step through the baselines.<br />
This will make it easier to isolate the bad antennas. Now plot the phases, iterating through baselines to ea02:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='phase',iteraxis='baseline')<br />
</source><br />
You see the slopes due to residual delays. Mostly a turn or less over a 128MHz subband, but there are some outliers.<br />
Step through to ea20. You see that there is a very large delay in RR (via locate) for<br />
the first baseband (spw 0~7). We will delete this (will also delete LL so there are no orphan polarization products, which would be ignored by {{clean}} in the imaging stage).<br />
Note ea17 and ea25 baselines drop close to zero in the middle of upper baseband (e.g. plot 'ea17&ea25') so we will delete these.<br />
<br />
To carry out flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea13"',<br />
'antenna="ea17" spw="10~17"',<br />
'antenna="ea25" spw="10~17"',<br />
'antenna="ea20" spw="2~9"']<br />
flagcmd(vis='SN2010FZ_10s.ms',inpmode='list',inpfile=flaglist,action='apply',flagbackup=True)<br />
</source><br />
These commands will be carried out as well as being added to the FLAG_CMD table (marked as applied).<br />
<br />
Plot the data again, now that is has been flagged:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='',spw='5:30~33',avgchannel='64', \<br />
antenna='ea01&ea02',correlation='RR,LL',xaxis='time',yaxis='amp')<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')<br />
</source><br />
<br />
[[Image:plotSN2010FZ_plotms_ea02fld0.png|200px|thumb|right|plotms field 0 ea02 amp vs frequency]]<br />
Now our phase calibrator - it is weaker, and we now start to really see the RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17',antenna='ea02', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')<br />
</source><br />
Use the Zoom feature, Mark rectangles and use Locate to identify the frequency/channel of RFI. In particular, we note in our analysis:<br />
* 6614MHz (spw 10 ch 63) super strong<br />
* 6772-6778MHz (spw 12 ch 14-17)<br />
* 7260-7264MHz (spw 16 ch 2-4)<br />
* 7314-7340MHz (spw 16 ch 29-42)<br />
* 7402-7418MHz (spw 17 ch 9-17)<br />
* 7458-7466MHz (spw 17 ch 37-41)<br />
* 7488MHz (spw 17 ch 52)<br />
<br />
If you plot all antennas and avoid the band edges you see spw 16 and 17 are pretty wiped out:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17:4~59',antenna='', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')<br />
</source><br />
<br />
For now we will not flag these spectral windows, but note the bad channels, which we will mask out when creating continuum calibration tables and images.<br />
<br />
Finally, split off the good scans and spw, this will allow us to work on the data without having to start completely over (if we mess something up badly) as well as letting us do simpler data selections. Note that we do not include spw 10, because of the bad RFI, or spw 11, because of the many missing antennas.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_flagged10s.ms')<br />
split(vis='SN2010FZ_10s.ms',outputvis='SN2010FZ_flagged10s.ms',datacolumn='data',spw='2~9,12~17',scan='7~43')<br />
</source><br />
<br />
You now have a MS called <tt>SN2010FZ_flagged10s.ms</tt> in your working area. This should be 2.8GB in size, which you can see while still at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh SN2010FZ_flagged10s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotSN2010FZ_plotms_datastream_zoomed.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot, zoomed in on last scan]]<br />
At this point it is useful to plot a "datastream" view of the dataset to show what antennas are present at what time. You can do this using<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='',correlation='RR,LL',<br />
timerange='',antenna='',spw='0:31',<br />
xaxis='time',yaxis='antenna2',<br />
plotrange=[-1,-1,0,26],coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines TO a given Antenna2 (which means there is no line for ea01 which is antenna 0). You can pick up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot, having zoomed in on the last scan on 3C286. You see here that some antennas are present in this scan earlier than others (e.g. ea02 comes in one 10s integration later than ea04).<br />
<br />
== Calibration ==<br />
<br />
Summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('SN2010FZ_flagged10s.ms')<br />
</source><br />
In the logger we see:<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
<br />
================================================================================<br />
MeasurementSet Name: SN2010FZ_flagged10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Alicia M. Soderberg Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 1375038 Total integration time = 3042 seconds<br />
Observed from 11-Jul-2010/21:36:01.0 to 11-Jul-2010/22:26:43.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
11-Jul-2010/21:36:01.0 - 21:38:20.5 7 0 J0925+0019 73710 9.93 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
21:38:44.0 - 21:39:51.0 9 1 SN2010FZ 39312 9.16 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:40:01.0 - 21:41:20.5 10 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:41:30.0 - 21:42:50.0 11 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:43:00.0 - 21:44:20.0 12 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:44:30.0 - 21:45:50.0 13 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:46:00.0 - 21:47:19.5 14 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:47:29.0 - 21:47:49.0 15 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:48:12.0 - 21:49:18.5 16 0 J0925+0019 39312 9 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
21:49:42.0 - 21:50:49.0 17 1 SN2010FZ 39312 9.17 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:50:59.0 - 21:52:19.0 18 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:52:29.0 - 21:53:48.5 19 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:53:58.0 - 21:55:18.0 20 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:55:28.0 - 21:56:48.0 21 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:56:58.0 - 21:58:18.0 22 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:58:28.0 - 21:58:47.5 23 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:59:10.5 - 22:00:17.0 24 0 J0925+0019 39312 8.99 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
22:00:39.5 - 22:01:47.0 25 1 SN2010FZ 39312 9.18 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:01:57.0 - 22:03:17.0 26 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:03:27.0 - 22:04:47.0 27 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:04:57.0 - 22:06:16.5 28 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:06:26.0 - 22:07:46.0 29 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:07:56.0 - 22:09:16.0 30 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:09:26.0 - 22:09:45.5 31 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:10:08.0 - 22:11:15.5 32 0 J0925+0019 39312 9.13 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
22:11:38.0 - 22:12:45.5 33 1 SN2010FZ 39312 9.19 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:12:55.0 - 22:14:15.0 34 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:14:25.0 - 22:15:45.0 35 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:15:55.0 - 22:17:15.0 36 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:17:25.0 - 22:18:44.5 37 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:18:54.0 - 22:20:14.0 38 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:20:24.0 - 22:20:43.5 39 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:21:06.0 - 22:22:13.5 40 0 J0925+0019 38584 9.15 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
22:25:13.0 - 22:25:13.0 42 2 3C286 924 2.88 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
22:25:23.0 - 22:26:43.0 43 2 3C286 43148 9.6 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
(nVis = Total number of time/baseline visibilities per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nVis <br />
0 D J0925+0019 09:25:07.81503 +00.19.13.9334 J2000 0 230230 <br />
1 NONE SN2010FZ 09:42:04.77000 +00.19.51.0000 J2000 1 1100736<br />
2 K 3C286 13:31:08.28798 +30.30.32.9589 J2000 2 44072 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (14 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 4488 2000 128000 RR RL LR LL <br />
1 64 TOPO 4616 2000 128000 RR RL LR LL <br />
2 64 TOPO 4744 2000 128000 RR RL LR LL <br />
3 64 TOPO 4872 2000 128000 RR RL LR LL <br />
4 64 TOPO 5000 2000 128000 RR RL LR LL <br />
5 64 TOPO 5128 2000 128000 RR RL LR LL <br />
6 64 TOPO 5256 2000 128000 RR RL LR LL <br />
7 64 TOPO 5384 2000 128000 RR RL LR LL <br />
8 64 TOPO 6744 2000 128000 RR RL LR LL <br />
9 64 TOPO 6872 2000 128000 RR RL LR LL <br />
10 64 TOPO 7000 2000 128000 RR RL LR LL <br />
11 64 TOPO 7128 2000 128000 RR RL LR LL <br />
12 64 TOPO 7256 2000 128000 RR RL LR LL <br />
13 64 TOPO 7384 2000 128000 RR RL LR LL <br />
<snip><br />
</pre><br />
Note that the spectral windows are re-numbered to 0 through 13.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibrating the data. The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which are then collectively applied to the science data. <br />
For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
Before calibrating, we insert a model for flux calibration source 3C286 into the MS. In order to do this, we first have to locate the model image on our system with {{setjy}}, which we will also use to set the flux density scale. The {{setjy}} task (in release 3.3.0 and later) has an option to list possible model images it knows about:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='SN2010FZ_flagged10s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation:<br />
<pre><br />
<br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /usr/lib64/casapy/release/4.2.0/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_S.im 3C147_K.im 3C147_X.im 3C286_Q.im 3C48_C.im 3C48_U.im<br />
3C138_C.im 3C138_U.im 3C147_L.im 3C286_A.im 3C286_S.im 3C48_K.im 3C48_X.im<br />
3C138_K.im 3C138_X.im 3C147_Q.im 3C286_C.im 3C286_U.im 3C48_L.im README<br />
3C138_L.im 3C147_A.im 3C147_S.im 3C286_K.im 3C286_X.im 3C48_Q.im<br />
3C138_Q.im 3C147_C.im 3C147_U.im 3C286_L.im 3C48_A.im 3C48_S.im<br />
</pre><br />
The relevant image for our purposes is <tt>3C286_C.im</tt>, in the directory <tt>/usr/lib64/casapy/release/data/nrao/VLA/CalModels</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since it knows about this image, we only have to give the image name and not the entire path. Otherwise, you will need to give it the entire path. We now run the task using this model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
mysetjy = setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, model='3C286_C.im', usescratch=False)<br />
</source><br />
<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We have not specified a Flux Density Scale Standard and are thus using the default (<tt>standard='Perley-Butler 2010'</tt>) as that was current when these observations were taken. In particular, there is a more recent "Perley-Butler 2013" scale that most users will want to use! See <tt>help setjy</tt> for more details.<br />
<br />
Inspecting the logger report shows that 3C286 is about 7.7 Jy at lower end of the band to 5.7 Jy at the upper end.<br />
<br />
Note: With release 4.2 {{setjy}} now returns a dictionary to Python, which we have captured in a variable. This can be used in scripts.<br />
<br />
=== Deriving pre-determined calibrations: antenna position corrections, gain-elevation curves, and requantizer gains ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, and requantizer gains.<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the time they were determined and when they were applied by the observing system, compared to the times in your observations.<br />
<source lang="python"><br />
# In CASA<br />
gencal('SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.antpos',caltype='antpos',antenna='')<br />
</source><br />
You should see in the logger:<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea01 : 0.00000 0.00300 0.00000<br />
offsets for antenna ea02 : -0.00080 0.00000 0.00000<br />
offsets for antenna ea03 : -0.00280 0.00000 0.00000<br />
offsets for antenna ea05 : 0.00000 0.00280 0.00000<br />
offsets for antenna ea06 : 0.00220 0.00100 0.00590<br />
offsets for antenna ea10 : 0.00080 0.00300 -0.00140<br />
offsets for antenna ea11 : 0.00090 0.00000 0.00000<br />
offsets for antenna ea12 : -0.00280 0.00000 0.00000<br />
offsets for antenna ea13 : 0.00000 -0.00080 0.00000<br />
offsets for antenna ea17 : -0.00120 0.00000 0.00000<br />
offsets for antenna ea18 : 0.00040 -0.00080 0.00040<br />
offsets for antenna ea22 : -0.00370 -0.00130 0.00000<br />
offsets for antenna ea23 : -0.00140 0.00000 0.00000<br />
offsets for antenna ea24 : -0.00150 0.00000 0.00000<br />
offsets for antenna ea26 : -0.00190 0.00000 0.00210<br />
offsets for antenna ea27 : 0.00000 0.00190 -0.00160<br />
</pre><br />
Note that there are significant position corrections for a number of the antennas. <br />
<br />
In CASA 4.1, we now have the option to use {{gencal}} to create a calibration table containing the gain curves for the antennas. Although you can still use the <tt>gaincurve=True</tt> option in each task, we will make use of this new feature (note that the <tt>gaincurve=True</tt> will be phased out in future CASA releases):<br />
<source lang="python"><br />
# In CASA<br />
gencal('SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.gaincurve',caltype='gc')<br />
</source><br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data (and our SN2010FZ is 8-bit), we include it here for completeness. It will not affect the calibration for our 8-bit data, but if one is following this CASA Guide as a template for 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration.<br />
<source lang="python"><br />
# In CASA<br />
gencal('SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.requantizer',caltype='rq')<br />
</source><br />
<br />
Since we're running {{gencal}} on 3-bit data, it logs that it found "0 TIME/SPW switched power samples."<br />
<br />
The caltables we have generated -- <tt>calSN2010FZ.antpos</tt>, <tt>calSN2010FZ.gaincurve</tt>, and <tt>calSN2010FZ.requantizer</tt> -- will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and bandpass ===<br />
<br />
[[Image:plotSN2010FZ_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotSN2010FZ_plotcal_delays_4.2.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotSN2010FZ_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant 16~26]]<br />
[[Image:plotSN2010FZ_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant 16~26]]<br />
[[Image:plotSN2010FZ_plotcal_B0ea14_4.0.png|200px|thumb|right|plotcal B0 amp and phase vs. freq for ea14]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels in each spw on the bandpass/flux calibrator 3c286 to flatten them before solving for the bandpass. Note where we saw RFI in the higher spw and avoid those channels. The range 23~28 should work. Pick a refant near center - ea04 is a reasonable bet (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G0',field='2',spw='0~13:23~28', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve'],\<br />
gaintype='G',refant='ea04',calmode='p',solint='int',minsnr=3) <br />
</source><br />
<br />
* <tt>refant='ea04'</tt> : try to use ea04 as the reference antenna<br />
* <tt>solint='int'</tt> : do a per-integration solve (every 10 seconds, since we've time-averaged the data)<br />
* <tt>minsnr=3</tt> : apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged<br />
* <tt>gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve']</tt> : pre-apply the antpos and gaincurve caltables<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the caltable in another task, use the Quit button on the GUI to dismiss the plotter and free up the lock on the caltable. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page multipanel plots (like those shown to the right), particularly for a<br />
hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase', \<br />
antenna='0~10,12~15',subplot=531,iteration='antenna', \<br />
plotrange=[-1,-1,-180,180],showgui=False,fontsize=6.0, \<br />
figfile='plotSN2010FZ_plotcal_G0p1.png')<br />
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase', \<br />
antenna='16~26',subplot=531,iteration='antenna', \<br />
plotrange=[-1,-1,-180,180],showgui=False,fontsize=6.0, \<br />
figfile='plotSN2010FZ_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that we saw in phase vs. frequency.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We avoid the beginning of spw 0 due to the extreme roll-off (with loss of S/N) at the<br />
starting edge.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.K0',\<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.G0'],\<br />
field='2',spw='0:8~59,1~13:4~59',gaintype='K', \<br />
refant='ea04',combine='scan',solint='inf',minsnr=3)<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -6 to 6 nanoseconds.<br />
<br />
Now solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spw due to how amplitude scaling adjusts weights internally during solving.<br />
<br />
You will see in the terminal some reports of solutions failing below our default S/N>3 cutoff:<br />
<pre><br />
32 of 50 solutions flagged due to SNR < 3 in spw=0 (chan=1) at 2010/07/11/22:26:05.4<br />
44 of 50 solutions flagged due to SNR < 3 in spw=0 (chan=0) at 2010/07/11/22:26:05.4<br />
</pre><br />
<br />
These are in the first two edge channels of the first spw where the response is low, and not unexpected. <br />
In the logger you will also see reports of reference antennas jumping in those channels, which can be <br />
be safely ignored (we will drop those channels later anyway).<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calSN2010FZ.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>). If we were at higher frequency we would also have made an opacity caltable (or set <tt>opacity</tt>).<br />
<br />
Now plot this, in amplitude then phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp',iteration='antenna')<br />
#<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
or to plot them all together<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp',<br />
antenna='0~10,12~15',subplot=531,iteration='antenna',<br />
fontsize=6.0, figfile='plotSN2010FZ_plotcal_B0a1_4.2.png')<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp',<br />
antenna='16~26',subplot=531,iteration='antenna',<br />
fontsize=6.0, figfile='plotSN2010FZ_plotcal_B0a2_4.2.png')<br />
#<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase',<br />
antenna='0~10,12~15',subplot=531,iteration='antenna',<br />
plotrange=[-1,-1,-180,180],fontsize=6.0, <br />
figfile='plotSN2010FZ_plotcal_B0p1_4.2.png')<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase',<br />
antenna='16~26',subplot=531,iteration='antenna',<br />
plotrange=[-1,-1,-180,180],fontsize=6.0, <br />
figfile='plotSN2010FZ_plotcal_B0p2_4.2.png')<br />
</source><br />
(this can take a long time to plot).<br />
<br />
In the bandpass phase you no longer see the residual antenna delays (just residual spw phase offsets from <br />
the delay solution registration) but there are some band edge effects.<br />
Note that some antennas have a little strange bandpasses at upper end of lower baseband in spw 5,6,7<br />
(e.g. ea14,ea16,ea17,ea25).<br />
To plot amp and phase for a single antenna versus frequency (see plots at right):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp', \<br />
antenna='ea14',subplot=211)<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase', \<br />
antenna='ea14',subplot=212,plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Because our flux density calibrator 3C286 is bright enough, we were able to use this as the bandpass calibrator.<br />
Since {{setjy}} put the correct spectrum for 3C286 into the MODEL_DATA column, our bandpass will reflect the<br />
true bandpass of the instrument. However, if for your observation you were unable to use a source of known spectrum <br />
as the bandpass calibrator, then you would need to use the output of {{fluxscale}} later on to bootstrap a {{setjy}} <br />
on your bandpass source using the derived spectral index information.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotSN2010FZ_plotcal_G1intp1_4.0.png|200px|thumb|right|plotcal G1int per-int phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G1intp2_4.0.png|200px|thumb|right|plotcal G1int per-int phase ant 16~26]]<br />
<br />
[[Image:plotSN2010FZ_plotcal_G1intp_ea01_4.0.png|200px|thumb|right|plotcal G1int per-int phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G1infp_ea01_4.0.png|200px|thumb|right|plotcal G1inf per-scan phase ant 0~15]]<br />
<br />
Now calibrate phases using the full bandwidth. <br />
First both our calibrators, one at a time - we could do them together, but in general you might need<br />
to do different solution intervals for each, so we keep the runs separate to illustrate how to <br />
do separate solutions and append them.<br />
We exclude RFI channels here, and obtain one solution per integration (these are bright enough):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1int', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0'], \<br />
field='2',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='int',gaintype='G',calmode='p')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1int', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='int',gaintype='G',calmode='p',append=True)<br />
</source><br />
These will get applied when solving for amplitudes, and when calibrating the calibrators themselves.<br />
<br />
The phases look reasonably connected:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G1int',xaxis='time',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we make a second table with one solution on our gain calibrator per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1inf',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',gaintype='G',calmode='p')<br />
</source><br />
These scan phases will get interpolated by {{applycal}} onto our target. These look good also:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G1inf',xaxis='time',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now solve for amplitudes on a per scan interval, after applying the per-integration phases. <br />
Do these separately using <tt>gainfield</tt> so phases don't get<br />
transferred across fields. For field 2 (3C286) we use <tt>combine='scan'</tt> as there are two scans <br />
on this source, with the first one having much less data (and will thus give a noisy solution on its own).<br />
Note that {{gaincal}} uses linear interpolation of the previously determined phases by default, so <br />
set this to "nearest" if you want to override this.<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'], \<br />
gainfield=['','','2','2','2'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='2',refant='ea04',solnorm=F,<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'],\<br />
gainfield=['','','2','2','0'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',gaintype='G',calmode='a',append=True)<br />
</source><br />
This is the table we will apply to the data.<br />
<br />
[[Image:plotSN2010FZ_plotcal_G2infa1_4.0.png|200px|thumb|right|plotcal G2 per-scan amp ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G2infa2_4.0.png|200px|thumb|right|plotcal G2 per-scan amp ant 16~26]]<br />
<br />
We do a second version of the amplitude calibration, this time using <tt>combine='scan'</tt> on field 0. This is <br />
to use for input to {{fluxscale}} in the next step.<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G3', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'], \<br />
gainfield=['','','2','2','2'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='2',refant='ea04',solnorm=F,<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G3', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'],\<br />
gainfield=['','','2','2','0'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',combine='scan',gaintype='G',calmode='a',append=True)<br />
</source><br />
<br />
Since the flux on the gain calibrator is not scaled to its correct flux (but to 1.0 Jy by default),<br />
use {{fluxscale}} to transfer the amplitude gains from 3c286:<br />
<source lang="python"><br />
# In CASA<br />
myflux = fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G3', \<br />
fluxtable='calSN2010FZ.F3inc',reference='2',transfer='0',<br />
incremental=True)<br />
</source><br />
where we have captured the returned dictionary in the Python variable <tt>myflux</tt>. We have used the<br />
<tt>incremental=True</tt> option (new to CASA 4.0) to make this table contain only the scale factors <br />
per-antenna per-spw per-field needed to scale the data (rather than rescaling the input table). Thus, it<br />
can be applied in addition to our <tt>G2</tt> table even though it was derived from the <tt>G3</tt> table.<br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C286<br />
Found transfer field(s): J0925+0019<br />
Flux density for J0925+0019 in SpW=0 (freq=4.488e+09 Hz) is: 0.977483 +/- 0.00278572 (SNR = 350.891, N = 50)<br />
Flux density for J0925+0019 in SpW=1 (freq=4.616e+09 Hz) is: 0.975972 +/- 0.00253876 (SNR = 384.429, N = 50)<br />
Flux density for J0925+0019 in SpW=2 (freq=4.744e+09 Hz) is: 0.978538 +/- 0.00242824 (SNR = 402.982, N = 50)<br />
Flux density for J0925+0019 in SpW=3 (freq=4.872e+09 Hz) is: 0.979278 +/- 0.00244155 (SNR = 401.088, N = 50)<br />
Flux density for J0925+0019 in SpW=4 (freq=5e+09 Hz) is: 0.981804 +/- 0.00219239 (SNR = 447.823, N = 50)<br />
Flux density for J0925+0019 in SpW=5 (freq=5.128e+09 Hz) is: 0.981478 +/- 0.00314805 (SNR = 311.773, N = 50)<br />
Flux density for J0925+0019 in SpW=6 (freq=5.256e+09 Hz) is: 0.985493 +/- 0.00343534 (SNR = 286.869, N = 50)<br />
Flux density for J0925+0019 in SpW=7 (freq=5.384e+09 Hz) is: 0.978491 +/- 0.00201807 (SNR = 484.865, N = 50)<br />
Flux density for J0925+0019 in SpW=8 (freq=6.744e+09 Hz) is: 0.959005 +/- 0.00260159 (SNR = 368.623, N = 48)<br />
Flux density for J0925+0019 in SpW=9 (freq=6.872e+09 Hz) is: 0.955123 +/- 0.00262785 (SNR = 363.462, N = 48)<br />
Flux density for J0925+0019 in SpW=10 (freq=7e+09 Hz) is: 0.954202 +/- 0.00281227 (SNR = 339.3, N = 48)<br />
Flux density for J0925+0019 in SpW=11 (freq=7.128e+09 Hz) is: 0.950797 +/- 0.00354085 (SNR = 268.522, N = 48)<br />
Flux density for J0925+0019 in SpW=12 (freq=7.256e+09 Hz) is: 0.94732 +/- 0.00391511 (SNR = 241.965, N = 48)<br />
Flux density for J0925+0019 in SpW=13 (freq=7.384e+09 Hz) is: 0.939356 +/- 0.00383532 (SNR = 244.922, N = 48)<br />
Fitted spectrum for J0925+0019 with fitorder=1: Flux density = 0.968048 +/- 0.00159415 (freq=5.74863 GHz) <br />
spidx=-0.0721976 +/- 0.00943577<br />
...<br />
</pre><br />
You may see slightly different numbers on your machine (and will see more extensive output). Note that "N" here is the number of antennas x the number of polarizations used for the calculations; in this case, there are 24 unflagged antennas and 2 polarizations. As of CASA 4.0, {{fluxscale}} now returns a fitted spectral index (and possibly curvature, e.g. if fitorder>1), which can be input to {{setjy}} if you want to use these derived fluxes for a model. <br />
<br />
As it so happens, the derived flux for J0925+0019 is about 1 Jy (you can plot up the raw amplitudes for fields 0,2 and convince yourself this is indeed true and not a bug). The spectrum rises a bit to peak in spw 6 then falls again. We will not use the fitted spectrum (setjy does not yet take fitorder>1) but will apply a incremental table in subsequent processing.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we actually apply all our accumulated calibration tables. We apply these to the <br />
calibration fields individually using the appropriate gainfields and interpolation for each:<br />
* For 3C286 (field 2) we did short-timescale phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
* For the nearby gain calibrator (field 0) we did only scan-based phase and amplitude solutions so we use "nearest" interpolation<br />
* For the target source we use field 0 to calibrate field 1, so use "linear" interpolation. This takes a few minutes.<br />
<br />
[[Image:plotSN2010FZ_plotms_applied_fld2.png|200px|thumb|right|plotms of 3C286 with calibration applied]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0',<br />
'calSN2010FZ.B0','calSN2010FZ.G1int','calSN2010FZ.G2'], \<br />
gainfield=['','','','','2','2'],<br />
interp=['','','nearest','nearest','nearest','nearest'], \<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0',<br />
'calSN2010FZ.B0','calSN2010FZ.G1int','calSN2010FZ.G2',<br />
'calSN2010FZ.F3inc'], \<br />
gainfield=['','','','','0','0','0'],<br />
interp=['','','nearest','nearest','nearest','nearest',''], \<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='1', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0',<br />
'calSN2010FZ.B0','calSN2010FZ.G1inf','calSN2010FZ.G2',<br />
'calSN2010FZ.F3inc'], \<br />
gainfield=['','','','','0','0','0'],<br />
interp=['','','nearest','nearest','linear','linear',''], \<br />
parang=False,calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will store the calibrated data.<br />
<br />
We can examine the corrected data on 3c286 using our RFI mask from above and avoiding band edges<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
See figure above right. There is clearly discrepant data visible spw 5 and 6, in particular for baseline ea17&ea25 (use the '''Mark Regions''' [[Image:MarkRegionsButton.png]] tool on some of it and then use the '''Locate''' [[File:casaplotms-locate-tool.png]] tool), which gives a really strange response. You can plot just this baseline to be sure:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
antenna='ea17&ea25', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
You can exclude this through antenna negation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
antenna='!ea17&ea25', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Then use '''Locate''' [[File:casaplotms-locate-tool.png]] for the other bad points, which seem to indicate spw 5,6,7 for ea14,ea16,ea17,ea25.<br />
Exclude these and replot:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
antenna='!ea14;!ea16;!ea17;!ea25', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld2.png|200px|thumb|right|plotms cal applied flagged fld2]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld2_phase.png|200px|thumb|right|plotms cal applied flagged fld2 phase]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_amp.png|200px|thumb|right|plotms cal applied flagged fld0 amp]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phase.png|200px|thumb|right|plotms cal applied flagged fld0 phase]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_amp_exc_4.0.png|200px|thumb|right|plotms cal applied flagged fld0 amp, with new spw selection]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_ampavg_4.0.png|200px|thumb|right|plotms cal applied flagged fld0 amp averaged]]<br />
<br />
This now looks clean except for the RFI in the upper subbands.<br />
<br />
Do flagging based on these:<br />
<source lang="python"><br />
# In CASA<br />
flaglist2 = ['antenna="ea14,ea16,ea17,ea25" spw="5~7"']<br />
flagcmd(vis='SN2010FZ_flagged10s.ms',inpmode='list',inpfile=flaglist2,action='apply')<br />
</source><br />
<br />
Now replot the corrected data (you may have to force reload if you plotted same thing right before this):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Looks pretty good.<br />
<br />
Plot the phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')<br />
</source><br />
Note the characteristic "bowtie" pattern of the phases about the sub-band centers.<br />
Here we can see the effect of the EVLA "delay clunking", where the delay steps through discrete values such that<br />
the phase goes from -11deg to +11deg across the sub-band as the delay changes due to geometry. This is D-configuration so the delays change slowly, it will change faster in wider configurations. As of Q3 2011 we have not enabled the corrections for this in the EVLA system so you will always have this remaining delay error in your data. In principle, you could solve for delays on short timescales and take this out; in practice, this in not possible for your weaker science target source (where it would matter most for results).<br />
<br />
Now let's plot the corrected data amplitude for the phase calibrator (field 0):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
You can see the bandpass filter roll-off increasing the noise at the baseband edges (about 8-16 channels worth). Also, we can see some RFI we missed:<br />
* <6804 MHz spw 8 below ch 30 lots of bad stuff (a lot from ea18,ea22 but others too)<br />
* 7168 MHz spw 11 ch 20<br />
* pretty much all of spw 12,13<br />
The ch 20 ones are all harmonics of a notorious 128 MHz tone. NOTE: You can get the frequency of a RFI feature by looking at the logger report from using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool.<br />
<br />
We will not flag these, but exclude them in imaging (so that more advanced students can try flagging these in detail or using auto-flagging). A good channel selection string for imaging might be:<br />
<br />
<pre><br />
spw = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'<br />
</pre><br />
<br />
Without further flagging, it may be best to drop spw 12-13 for imaging (we will do so from now on).<br />
<br />
Plot again (including this selection for spw 0-11):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Looks better.<br />
<br />
Now plot amplitudes for the corrected data averaged over baseline to see the source spectrum:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0',<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59',<br />
correlation='RR,LL',avgbaseline=True,avgtime='60000s',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
The "custom" plotting parameters show how to control the symbol shape and size from the task.<br />
<br />
The last two sub-bands spw 12-13 give reasonable values, with only a tiny offset from spw 8-11.<br />
There are also strange amplitude excursions, particularly in the low end of the first baseband. These must be coming<br />
from one or more scans. You can iterate over scan to see the strange amplitudes (mostly from scan 7):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0',<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59',<br />
correlation='RR,LL',avgbaseline=True,avgtime='600s',iteraxis='scan',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
<br />
Also, there is an offset with the amplitudes for spw 6, perhaps due to the problem with baseline ea17&ea25 (which we flagged, but didn't recalibrate afterward) and likely affected the {{fluxscale}} solution. This is troubling enough that we will quickly go through a second round of calibration.<br />
<br />
== A Quick Recalibration ==<br />
<br />
We now go back and recalibrate the data. We may as well flag scan 7 first, as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='SN2010FZ_flagged10s.ms', scan='7')<br />
#<br />
# Clear the corrected data and model from header<br />
clearcal('SN2010FZ_flagged10s.ms',addmodel=False)<br />
#<br />
chanStr = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'<br />
#<br />
mysetjy2 = setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, modimage='3C286_C.im')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G0.2',field='2',spw='0~11:23~28',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve'],<br />
gaintype='G',refant='ea04',calmode='p',solint='int',minsnr=3)<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.K0.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.G0.2'],<br />
field='2', spw=chanStr, gaintype='K',<br />
refant='ea04', combine='scan', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.G0.2','calSN2010FZ.K0.2'],<br />
field='2',refant='ea04',solnorm=False,<br />
spw='0~11', <br />
bandtype='B', combine='scan', solint='inf')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2int',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2'],<br />
field='2',refant='ea04',solnorm=F, <br />
spw=chanStr,<br />
solint='int',gaintype='G',calmode='p')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2int',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='int',gaintype='G',calmode='p',append=True)<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2inf',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',gaintype='G',calmode='p')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','2'], <br />
interp=['','','nearest','nearest','nearest'],<br />
field='2',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','0'], <br />
interp=['','','nearest','nearest','nearest'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',gaintype='G',calmode='a',append=True)<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.3',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','2'],<br />
interp=['','','nearest','nearest','nearest'],<br />
field='2',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.3',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','0'], <br />
interp=['','','nearest','nearest','nearest'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',combine='scan',gaintype='G',calmode='a',append=True)<br />
#<br />
myflux2 = fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G2.3',<br />
fluxtable='calSN2010FZ.F2.3inc',reference='2',transfer='0',<br />
incremental=True)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='2',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2int','calSN2010FZ.G2.2'],<br />
gainfield=['','','','','2','2'],<br />
interp=['','','nearest','nearest','linear','nearest'],<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='0',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2int','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3inc'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','nearest','nearest',''],<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='1',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2inf','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3inc'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','linear','linear',''],<br />
parang=False,calwt=False)<br />
</source><br />
<br />
Note that we have set the variable <tt>chanStr</tt> for our channel selection; this makes the task commands shorter and easier to read.<br />
<br />
The {{fluxscale}} output this time around is slightly different to the last:<br />
<pre><br />
Found reference field(s): 3C286<br />
Found transfer field(s): J0925+0019<br />
Flux density for J0925+0019 in SpW=0 (freq=4.488e+09 Hz) is: 0.978946 +/- 0.00284837 (SNR = 343.686, N = 50)<br />
Flux density for J0925+0019 in SpW=1 (freq=4.616e+09 Hz) is: 0.978634 +/- 0.00264066 (SNR = 370.602, N = 50)<br />
Flux density for J0925+0019 in SpW=2 (freq=4.744e+09 Hz) is: 0.980438 +/- 0.00251668 (SNR = 389.575, N = 50)<br />
Flux density for J0925+0019 in SpW=3 (freq=4.872e+09 Hz) is: 0.980116 +/- 0.00255481 (SNR = 383.636, N = 50)<br />
Flux density for J0925+0019 in SpW=4 (freq=5e+09 Hz) is: 0.982175 +/- 0.00230804 (SNR = 425.545, N = 50)<br />
Flux density for J0925+0019 in SpW=5 (freq=5.128e+09 Hz) is: 0.979574 +/- 0.00269688 (SNR = 363.225, N = 42)<br />
Flux density for J0925+0019 in SpW=6 (freq=5.256e+09 Hz) is: 0.980193 +/- 0.00271312 (SNR = 361.279, N = 42)<br />
Flux density for J0925+0019 in SpW=7 (freq=5.384e+09 Hz) is: 0.98102 +/- 0.00249166 (SNR = 393.721, N = 42)<br />
Flux density for J0925+0019 in SpW=8 (freq=6.744e+09 Hz) is: 0.962693 +/- 0.00282815 (SNR = 340.397, N = 48)<br />
Flux density for J0925+0019 in SpW=9 (freq=6.872e+09 Hz) is: 0.960313 +/- 0.00285418 (SNR = 336.459, N = 48)<br />
Flux density for J0925+0019 in SpW=10 (freq=7e+09 Hz) is: 0.957056 +/- 0.00303716 (SNR = 315.116, N = 48)<br />
Flux density for J0925+0019 in SpW=11 (freq=7.128e+09 Hz) is: 0.953964 +/- 0.00378326 (SNR = 252.154, N = 48)<br />
Flux density for J0925+0019 in SpW=12 is: INSUFFICIENT DATA <br />
Flux density for J0925+0019 in SpW=13 is: INSUFFICIENT DATA <br />
Fitted spectrum for J0925+0019 with fitorder=1: Flux density = 0.973376 +/- 0.00118872 (freq=5.52174 GHz) <br />
spidx=-0.0573991 +/- 0.00778736201<br />
</pre><br />
<br />
The source spectrum plot now looks somewhat better:<br />
<br />
[[Image:plotSN2010FZ_plotms_reproc_fld0_ampavg_4.0.png|200px|thumb|right|plotms recalibrated applied flagged fld0 amp averaged]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',avgbaseline=True,avgtime='60000s',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
As you see in the figure to the right, there are still spectral window to window variations that deviate from a smooth spectrum. This is due to noise in the {{fluxscale}} median filter now used in CASA 4.0 (in this well-calibrated case, the old weighted means used by {{fluxscale}} in CASA3.4 behaved better). If we use {{plotcal}} to plot the solutions versus antenna<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G2.3',xaxis='antenna',yaxis='amp',field='0',<br />
subplot=211,plotrange=[-1,-1,0.9,1.1])<br />
plotcal(caltable='calSN2010FZ.G2.3',xaxis='antenna',yaxis='amp',field='2',<br />
subplot=212,plotrange=[-1,-1,0.9,1.1],figfile='plotSN2010FZ_plotcal_G2.3_ampant.png')<br />
</source><br />
we see that there are variations that will enter into the medians. Some antennas are better behaved than others, for example ea12 (index 10) seems better than most.<br />
<br />
[[Image:plotSN2010FZ_plotcal_G2.3_ampant.png|200px|thumb|right|plotcal of G2.3 table, showing variation of solutions per antenna]]<br />
[[Image:screenshotPlotSN2010FZ_plotcal_fluxedit3_ea12.png|200px|thumb|right|plotcal of G2.3.ea12 table, marking all solutions but those for ea12 for flagging]]<br />
[[Image:screenshotPlotSN2010FZ_plotms_recalibrated3_EA12_fld0_amp_4.0.png|200px|thumb|right|plotms for fld 0 after application of F2.3.ea12 table]]<br />
Because we are applying an incremental correction for the flux scale, we have the latitude to change the caltable that goes into {{fluxscale}} to get a better result. For example, we can restrict the antennas that are used to derive the scale. Although there is not yet antenna selection in {{fluxscale}} itself, we can edit the caltable using {{plotcal}}. For example, make a copy of the G2.3 caltable and select only a single antenna:<br />
<source lang="python"><br />
# In CASA<br />
os.system('cp -rf calSN2010FZ.G2.3 calSN2010FZ.G2.3.ea12')<br />
plotcal(caltable='calSN2010FZ.G2.3.ea12',xaxis='antenna',yaxis='amp')<br />
</source><br />
In the plot to the right we show the GUI where we have boxed all but antenna ea12.<br />
Now we carry on with the {{fluxscale}} and {{applycal}}:<br />
<source lang="python"><br />
# In CASA<br />
myfluxEdit3 = fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G2.3.ea12',<br />
fluxtable='calSN2010FZ.F2.3.ea12',reference='2',transfer='0',<br />
incremental=True)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='0',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2int','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3.ea12'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','nearest','nearest',''],<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='1',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2inf','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3.ea12'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','linear','linear',''],<br />
parang=False,calwt=False)<br />
</source><br />
The results appear better:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',avgbaseline=True,avgtime='60000s',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
Note that if you choose a different antenna than ea12 to use for this, you will get<br />
different results, usually worse. But this procedure illustrates how to use the<br />
incremental solutions from {{fluxscale}} to your possible advantage.<br />
<br />
We now return to examining our calibration.<br />
<br />
We can also plot the corrected phase - looks good:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')<br />
</source><br />
<br />
We can average over baseline and each scan:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',avgbaseline=True,avgtime='600s',<br />
xaxis='frequency',yaxis='phase',ydatacolumn='corrected')<br />
</source><br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phaseavg.png|200px|thumb|right|plotms cal applied flagged fld0 phase averaged]]<br />
<br />
In this case, we can see the residual effect of the EVLA "delay clunking" described above, but it is reduced due to the averaging that we applied, but it is still there.<br />
<br />
You can look at the target source field='1', but there are lots of data so you will need to do a lot of averaging.<br />
For example:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='1',avgtime='300s', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Alas, the upper baseband still has lots of low level RFI.<br />
<br />
Now split off the data for calibrators and target, to avoid later issues that can corrupt the MSs. We don't keep spw 12-15, since they weren't included in the last round of calibration, and we don't plan to image them.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_split10s.ms')<br />
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_split10s.ms', \<br />
datacolumn='corrected',field='1',spw='0~11')<br />
#<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_3c28610s.ms')<br />
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_3c28610s.ms', \<br />
datacolumn='corrected',field='2',spw='0~11')<br />
#<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_J092510s.ms')<br />
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_J092510s.ms', \<br />
datacolumn='corrected',field='0',spw='0~11')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
This is EVLA D-configuration data at C-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary_-_Current Observational Status Summary]:<br />
<br />
* Synthesized beam should be 12" at 6 GHz with primary beam field of view of 7.5 arcmin (450")<br />
<br />
Our data spans 4.5-7.5 GHz: this is a relatively large fractional bandwidth, resulting in substantial variation of the field of view over the entire frequency range. FOV = 45 arcmin / Frequency (GHz), giving 10 arcmin at 4.5 GHz, and 6 arcmin at 7.5 GHz. Likewise, the synthesized beam ranges from 16" at 4.5 GHz to 9.6" at 7.5 GHz. We want to subsample the synthesized beam by a factor of 3-4, so will use a cellsize of 3". To cover the full FOV (keeping it at the inner part of the image) at the lowest frequencies, we will want an image size of >400 pixels, or >20 arcmin.<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting,<br />
and will give reasonable resolution but will allow us to still see larger scale structure.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <br />
<tt>imsize</tt> should be composite number with two and only two prime factors chosen from<br />
2, 3, and 5. Taking into account the x1.2 padding that clean uses internally to the imsize<br />
you give it (and 1.2 = 2*3/5), we choose 640 or 1280 as our imsize (640 = 2^7*5). Other<br />
reasonable sets would be 405, 1215, etc. (405 = 3^4*5) or 432, 648, 1296 (these are 2^n*3^m*5).<br />
In practice, if you give it non-optimal values for imsize, you may find that the transforms<br />
take a bit longer, which is noticeable if you are doing interactive clean.<br />
<br />
WARNING: By default, a single-field nterms=1 clean does NOT use Cotton-Schwab (CS) clean to break<br />
into major cycles going back to data residuals, it just does cleaning in a bunch of minor<br />
cycles in the image plane. This can give much poorer imaging quality in cases with poor<br />
uv coverage (snapshots) or in the case of complex emission structure (like ours) -- clean tends to<br />
diverge in this case. You should explicitly set <tt>imagermode='csclean'</tt> in your<br />
call to clean. Also, in our case the psf is very good using mfs, so by default it will not<br />
take many major cycle breaks. We use the <tt>cyclefactor</tt> parameter to control this, which<br />
sets the break threshold to be cyclefactor times the max psf sidelobe level (outside the main<br />
peak). We start at <tt>cyclefactor=1.5</tt> in a single spw, and ratchet it up to 4.5 when we<br />
clean all the spw. This seems to work ok. Rule of thumb is if it is gobbling up many hundreds of<br />
clean iterations in the minor cycles early on, increase cyclefactor. Conversely, if your psf is poor<br />
but you source structure is simple, you can reduce cyclefactor (e.g. below 1) to stop it from taking<br />
lots of extra major cycles.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see<br />
[[EVLA_Continuum_Tutorial_3C391#Imaging]]. WARNING: In CASA 4.0 the GUI interface for clean <br />
and the viewer has changed slightly. Some of the screenshots shown below may differ slightly <br />
from what you see.<br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[[EVLA_6-cm_Wideband_Tutorial_SN2010FZ_(Caltech)#Cleaning_the_lower_baseband_using_two_MFS_Taylor_terms]] <br />
and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one of the lower baseband spw (spw 5 in this example).<br />
NOTE: this first time will take a few minutes at start to create scratch columns<br />
in the MS in case we want to do self-calibration later.<br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
[[Image:viewSN2010FZ_spw5_clean640_4.0.png|200px|thumb|right|interactive clean spw5 640x640 after around 1000 iterations]]<br />
[[Image:viewSN2010FZ_spw5_clean1280.png|200px|thumb|right|2nd interactive clean spw5 1280x1280 before cleaning]]<br />
[[Image:viewSN2010FZ_spw5_clean1280final_4.0.png|200px|thumb|right|viewer showing clean spw5 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw5_clean640*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='5:4~59', \<br />
imagename='imgSN2010FZ10s_spw5_clean640', \<br />
mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[640,640],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
</source><br />
<br />
* Start carefully by boxing the bright source and setting iterations to 10 at first<br />
* Gradually add more boxes and increase the number of iterations<br />
* Since this is not much more than a snapshot you see the six-fold sidelobe pattern<br />
of the extended emission in the center of the map. This decreases as you clean<br />
out this emission.<br />
* Stop cleaning when the residuals look like noise (and you cannot clearly see sources).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
The top figure to the right shows a zoom in on the end state of the clean, where<br />
we have marked a number of boxes and cleaned them out.<br />
<br />
Note that there are some strange sidelobe patterns in lower left, possibly <br />
from a source outside the image area. We can make a bigger image starting from<br />
our current model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw5_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='5:4~59', \<br />
imagename='imgSN2010FZ10s_spw5_clean1280', \<br />
mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
modelimage='imgSN2010FZ10s_spw5_clean640.model', \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
</source><br />
<br />
Sure enough, there is a bright source near the lower left (see middle panel at right). <br />
Box it, clean it a bit, and look again. There is a second source in the mid-left (track<br />
it down by its sidelobes). Box this one, clean it a bit, and when satisfied stop.<br />
<br />
You can use the CASA {{viewer}} to display the images that {{clean}} creates. If you need more guidance<br />
on using the viewer, see the [http://casa.nrao.edu/CasaViewerDemo/casaViewerDemo.html CASA Viewer Demo] video<br />
(note that this is for a much earlier version of the viewer, and the interface has changed since then). <br />
<br />
Bring up your restored image directly:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgSN2010FZ10s_spw5_clean1280.image')<br />
</source><br />
<br />
The restored image is shown in the bottom panel to the right. I have chosen the Grayscale1 instead of default color<br />
map as I prefer "Grayscale" to false color "Rainbow" for assessing image quality. Also, you can change the scaling of the image using the "scaling power cycles" slider under "basic settings".<br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw5_clean1280.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
In this particular case, it's 31.8 uJy; yours will likely be slightly different.<br />
<br />
=== Cleaning the lower baseband ===<br />
<br />
[[Image:viewSN2010FZ_spw0to7_clean1280final.png|200px|thumb|right|clean spw0-7 restored image center]]<br />
Now, image the entire lower baseband (spw 0-7).<br />
Follow same iterative procedure as before, and get the best<br />
residuals you can without "cleaning the noise". <br />
<br />
* Because of the bandwidth and frequency synthesis, the sidelobe pattern is different than before and it is much easier to see fainter emission.<br />
* Be careful cleaning sources that lie near or on sidelobe splotches.<br />
* Clean the central emission region way down first to reduce the sidelobe level before adding components in the sidelobe areas.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw0to7_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='0:16~59,1~6:4~59,7:4~54', \<br />
imagename='imgSN2010FZ10s_spw0to7_clean1280', \<br />
mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to7_clean1280.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
For this run, the rms is 11.3 uJy (and there is clearly some structure left in the residual). To the right is a zoom-in on the center of the restored image.<br />
<br />
==== Cleaning the lower baseband using two MFS Taylor terms ====<br />
<br />
The mfs nterms=2 option creates two "Taylor Term" images - an average intensity image (with suffix <tt>.image.tt0</tt>) <br />
and a spectral slope image (with suffix <tt>.image.tt1</tt>) which is intensity x alpha (where alpha is spectral index).<br />
For convenience there is a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "Reference Frequency" of the image (by default the center frequency of the spw selected, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). The convention for spectral index alpha is that<br />
<br />
<math><br />
S \propto \nu^\alpha<br />
</math><br />
<br />
so negative spectral indexes indicate a "steep" spectrum (falling with frequency).<br />
<br />
[[Image:viewSN2010FZ_spw0to7_mfs2clean.png|200px|thumb|right|clean spw0-7 mfs nterms=2 in progress]]<br />
Let's try using multi-frequency synthesis with nterms=2 on the lower baseband.<br />
The dirty beam will have lower sidelobes so we turn up <tt>cyclefactor</tt> for <tt>csclean</tt> a bit. Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgSN2010FZ10s_spw0to7_clean1280.mask'</tt> to use these as a starting point:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw0to7_mfs2_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='0:16~59,1~6:4~59,7:4~54', \<br />
imagename='imgSN2010FZ10s_spw0to7_mfs2_clean1280', \<br />
mode='mfs',nterms=2,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=4.5, \<br />
weighting='briggs',robust=0.5,interactive=True,mask=[])<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to7_mfs2_clean1280.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
For this run, the rms is 10.5 uJy (somewhat better-looking than the nterms=1).<br />
The top screenshot to the right shows an intermediate but early stage of cleaning where we are looking at<br />
the central emission and cleaning it out slowly.<br />
<br />
You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0')<br />
</source><br />
<br />
and then use the Open Data panel to load the spectral index image <tt>imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha</tt><br />
which can then be blinked (optionally plotted side-by-side using the Panel Display Options panel to set 2 panels in the x direction). <br />
<br />
[[Image:viewSN2010FZ_spw0to7_mfs2loadalpha_4.0.png|200px|thumb|right|clean spw0-7 mfs nterms=2 load alpha with LEL]]<br />
[[Image:viewSN2010FZ_spw0to7_mfs2panelalpha_4.0.png|200px|thumb|right|clean spw0-7 mfs nterms=2 tt0 and alpha (filtered at 0.1mJy in tt0)]]<br />
<br />
Note there is a lot of noise in alpha in the low-intensity regions, and thus filtering the alpha image based on the values in the tt0 image is desirable. You can use the {{immath}} task to make this filtered alpha image explicitly, using a <br />
Lattice Expression Language (LEL) expression: <br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha', <br />
'imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>1.0E-4]',<br />
outfile='imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.1 mJy (or 10 x the sigma we found) as the cutoff.<br />
You can then view or manipulate the filtered alpha image as normal.<br />
<br />
We can also use LEL to filter the alpha image on the intensity on-the-fly when we load this raster in the Open Data panel<br />
by specifying a LEL string in the LEL box instead of selecting the image from the directory <br />
listing. The LEL string:<br />
<br />
<pre><br />
'imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha'['imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0'>1.0E-04]<br />
</pre><br />
<br />
will replicate what we did above. The middle figure to the right shows the Open Data panel<br />
with our LEL string in it. Just click the Raster button to load this.<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed<br />
in on the galaxy emission. Mousing over the alpha shows spectral indexes ranging from -1 to +1 in the center, with<br />
the brightest emission with alpha -0.7 in the knots in the disk.<br />
<br />
=== Cleaning using both basebands combined ===<br />
<br />
For the ultimate image, use the "clean" part of the upper baseband in addition<br />
to the lower (use spw 0-11). We will use mfs with nterms=2 (if you try nterms=1 <br />
on this wide bandwidth you will get much poorer residuals). Because of the added<br />
work and extra data involved, this will take much longer than our other runs of<br />
clean. Therefore, we will get a head start by doing a non-interactive clean using<br />
the mask left from the previous clean (spw 0-7). We will insert a clean threshold<br />
to limit runaway cleaning too far beneath the noise level. <br />
<br />
This will take a while, especially if there are other processes running on your machine (with nothing else running, expect ~30-40 minutes).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw0to11_mfs2_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
imagename='imgSN2010FZ10s_spw0to11_mfs2_clean1280', \<br />
mode='mfs',nterms=2,niter=3000,gain=0.1,threshold='0.002mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=4.5, \<br />
mask=['imgSN2010FZ10s_spw0to7_mfs2_clean1280.mask'], \<br />
weighting='briggs',robust=0.5,interactive=False)<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
For this particular run, the rms was 8.9 uJy (noticeably better than the lower baseband only results).<br />
<br />
[[Image:viewSN2010FZ spw0to11_mfs2resid.png|200px|thumb|right|final residual and mask]]<br />
<br />
Let us see if there is more to clean. Bring this up in interactive mode:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='SN2010FZ_split10s.ms', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
imagename='imgSN2010FZ10s_spw0to11_mfs2_clean1280', \<br />
mode='mfs',nterms=2,niter=3000,gain=0.1,threshold='0.001mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=4.5, \<br />
mask='imgSN2010FZ10s_spw0to11_mfs2_clean1280.mask', \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
</source><br />
<br />
This should start cleaning from where our previous non-interactive clean left off.<br />
<b>Note for 4.2.0:</b> In this case we have specified <tt>mask='imgSN2010FZ10s_spw0to11_mfs2_clean1280.mask'</tt> explicitly due to a bug where it will not otherwise allow you to edit the mask interactively.<br />
<br />
You might find a few more sources revealed in the outer parts of the image, and also more <br />
emission around the galaxy disk in the center. Try drawing new boxes, perhaps extend the box<br />
in the center, and do ~100-1000 more iterations. At the end, what is left should be dominated<br />
by the error patterns from mis-calibration. Only self-calibration will get rid of<br />
these. Stop cleaning for now. See the figure to the right for the interactive display panel<br />
showing final residuals and mask (changing the colormap to <tt>Greyscale 1</tt>).<br />
<br />
Check the residual levels:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.residual.tt0')<br />
sigma = mystat['sigma'][0]<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
The final rms achieved here is 8.6 uJy; slightly better.<br />
<br />
== Analyzing the image ==<br />
<br />
Let's see how close we got to expected noise and dynamic range:<br />
<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0')<br />
peak = mystat['max'][0]<br />
print 'Image max flux = '+str(mystat['max'][0])<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.model.tt0')<br />
total = mystat['sum'][0]<br />
print 'Model total flux = '+str(mystat['sum'][0])<br />
#<br />
snr = peak/sigma<br />
print 'SN2010FZ peak S/N = '+str(snr)<br />
#<br />
snr = total/sigma<br />
print 'SN2010FZ total S/N = '+str(snr)<br />
</source><br />
The output gives:<br />
<pre><br />
Residual standard deviation = 8.60710739215e-06<br />
Image max flux = 0.00995589420199<br />
Model total flux = 0.0371581438531<br />
SN2010FZ peak S/N = 1156.70616717<br />
SN2010FZ total S/N = 4317.14653485<br />
</pre><br />
<br />
What do we expect? If we do {{listobs}} on this MS we see the scans:<br />
<pre><br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) <br />
11-Jul-2010/21:38:44.0 - 21:39:51.0 9 0 SN2010FZ 33696 9.16 <br />
21:40:01.0 - 21:41:20.5 10 0 SN2010FZ 37908 9.89 <br />
21:41:30.0 - 21:42:50.0 11 0 SN2010FZ 37908 10 <br />
21:43:00.0 - 21:44:20.0 12 0 SN2010FZ 37908 10 <br />
21:44:30.0 - 21:45:50.0 13 0 SN2010FZ 37908 10 <br />
21:46:00.0 - 21:47:19.5 14 0 SN2010FZ 37908 9.89 <br />
21:47:29.0 - 21:47:49.0 15 0 SN2010FZ 12636 9.67 <br />
21:49:42.0 - 21:50:49.0 17 0 SN2010FZ 33696 9.17 <br />
21:50:59.0 - 21:52:19.0 18 0 SN2010FZ 37908 10 <br />
21:52:29.0 - 21:53:48.5 19 0 SN2010FZ 37908 9.89 <br />
21:53:58.0 - 21:55:18.0 20 0 SN2010FZ 37908 10 <br />
21:55:28.0 - 21:56:48.0 21 0 SN2010FZ 37908 10 <br />
21:56:58.0 - 21:58:18.0 22 0 SN2010FZ 37908 10 <br />
21:58:28.0 - 21:58:47.5 23 0 SN2010FZ 12636 9.67 <br />
22:00:39.5 - 22:01:47.0 25 0 SN2010FZ 33696 9.18 <br />
22:01:57.0 - 22:03:17.0 26 0 SN2010FZ 37908 10 <br />
22:03:27.0 - 22:04:47.0 27 0 SN2010FZ 37908 10 <br />
22:04:57.0 - 22:06:16.5 28 0 SN2010FZ 37908 9.89 <br />
22:06:26.0 - 22:07:46.0 29 0 SN2010FZ 37908 10 <br />
22:07:56.0 - 22:09:16.0 30 0 SN2010FZ 37908 10 <br />
22:09:26.0 - 22:09:45.5 31 0 SN2010FZ 12636 9.67 <br />
22:11:38.0 - 22:12:45.5 33 0 SN2010FZ 33696 9.19 <br />
22:12:55.0 - 22:14:15.0 34 0 SN2010FZ 37908 10 <br />
22:14:25.0 - 22:15:45.0 35 0 SN2010FZ 37908 10 <br />
22:15:55.0 - 22:17:15.0 36 0 SN2010FZ 37908 10 <br />
22:17:25.0 - 22:18:44.5 37 0 SN2010FZ 37908 9.89 <br />
22:18:54.0 - 22:20:14.0 38 0 SN2010FZ 37908 10 <br />
22:20:24.0 - 22:20:43.5 39 0 SN2010FZ 12636 9.67 <br />
(nVis = Total number of time/baseline visibilities per scan) <br />
</pre><br />
(listing columns truncated) and we estimate about 37 minutes on target. We had about 25 antennas on average, and our spw selection picked out 610 channels (2 MHz each) for a total of 1220 MHz bandwidth. If we plug this<br />
into the<br />
[https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure EVLA exposure calculator], at 5 GHz, we find that we expect a rms thermal noise level of 8.7 uJy, and at 7 GHz, 7.0 uJy. So, our values are within the expected range (a bit higher than theoretical, but that's expected). <br />
<br />
[[Image:plotSN2010FZ_viewerfinal.png|200px|thumb|right|final image]]<br />
Look at this in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0')<br />
</source><br />
Zoom in on the center (see figure to the right).<br />
<br />
[[Image:viewSN2010FZ_spw0to11_mfs2tt1.png|200px|thumb|right|final tt1 image with box]]<br />
In the previous section we demonstrated how to process and display the spectral index image. You can do<br />
the same for this final image. Here, we will do some rough analysis on the spectral index to determine<br />
an intensity-weighted mean spectral index over the core region.<br />
The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image. See the figure to the right.<br />
Let's gate the Taylor-term images on intensity:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered')<br />
immath(imagename=['imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1',<br />
'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>5.0E-5]',<br />
outfile='imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered')<br />
immath(imagename=['imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>5.0E-5]',<br />
outfile='imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered')<br />
</source><br />
<br />
We can identify a box containing the central emission (see figure of tt1 in viewer) and note the corners.<br />
(We could also use the region tools from the viewer, but that is for another exercise.)<br />
Let us compute the intensity-weighted spectral index over this box by averaging<br />
these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered',<br />
box='503,533,756,762')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered',<br />
box='503,533,756,762')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha/avgtt0<br />
print 'SN2010FZ I-weighted Alpha = '+str(avgalpha)<br />
</source><br />
We get <br />
<pre><br />
SN2010FZ I-weighted Alpha = -1.38157453384<br />
</pre><br />
<br />
The emission in this source is on the steep side. At this point we do not know how reliable this is or<br />
what we expect (though our calibrators come out with correct spectral indexes if we image them the<br />
same way). But this illustrates a way to extract spectral information from our wideband mfs images.<br />
<br />
== Comparing with the Optical/Infrared ==<br />
<br />
As a final comparison, we turn to the Sloan Digital Sky Survey (SDSS) and a cutout image of our galaxy:<br />
[[Image:NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg|400px|thumb|center|]]<br />
from their [http://cosmo.nyu.edu/hogg/rc3/NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg RC3]<br />
album (courtesy D.Hogg, M.Blanton, SDSS collaboration - see [[#Credits]]). This looks like a nice nearby<br />
face-on spiral galaxy. How does our 6cm continuum emission line up with the optical?<br />
<br />
Here is the EVLA 6cm image side by side with a i-band image from the Sloan Digital Sky Survey (SDSS) registered to our image:<br />
<br />
[[Image:plotSN2010FZ viewerfinalandSDSS.png|600px|thumb|center|final and sdss image]]<br />
<br />
You can also find this image, named <tt>NGC_2967_UGC_5180_IRAS_09394+0033-i.fits</tt>, on the web at <tt>http://casa.nrao.edu/Data/EVLA/SN2010FZ/NGC_2967_UGC_5180_IRAS_09394+0033-i.fits</tt> (at the CASA workshop, it's in <tt>/data/casa/evla/</tt> or a similar location that will be given to you in the instructions). Load it into your viewer, and blink against our 6cm image.<br />
<br />
We can also plot one as a raster and the other overlaid as contours. You can load the SDSS image<br />
from the viewer Load Data panel and fiddle with contours. Once you know contour levels, you can<br />
also use the imview task to load a raster and contour image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
imview(raster={ 'file' : 'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'},<br />
contour = { 'file' : 'NGC_2967_UGC_5180_IRAS_09394+0033-i.fits',<br />
'levels' : [0.2, 0.5, 1, 1.5, 3],<br />
'base' : 0.0,<br />
'unit' : 1.0 } )<br />
</source><br />
<br />
The figure below shows the SDSS contours overlaid on our 6cm image (after fiddling with the <br />
colormap shift/slope for the EVLA raster image). <br />
<br />
[[Image:viewSN2010FZ_spw0to11_mfs2tt0plusSDSS.png|400px|thumb|center|6cm EVLA raster plus SDSS i-band contours]]<br />
<br />
Likewise, we can plot the SDSS image as a raster and overlay EVLA 6cm contours:<br />
<br />
<source lang="python"><br />
# In CASA<br />
imview(raster={ 'file' : 'NGC_2967_UGC_5180_IRAS_09394+0033-i.fits',<br />
'scaling' : -2.0,<br />
'range' : [0,10] },<br />
contour = { 'file' : 'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0',<br />
'levels' : [0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56],<br />
'base' : 0.0,<br />
'unit' : 0.001 },<br />
zoom = { 'blc' : [397,300],<br />
'trc' : [1567,1231] } )<br />
</source><br />
<br />
This is shown in the figure below. Is the compact 6cm emission in upper left associated with a<br />
spiral arm?<br />
<br />
[[Image:viewSN2010FZ_spw0to11_SDSSiplusEVLA6cm.png|400px|thumb|center|SDSS i-band raster plus EVLA 6cm contours]]<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Use multi-scale clean by adding non-zero scales to the <tt>multiscale</tt> parameter.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>testautoflag</tt> task (in 3.3.0 and later) to automatically flag RFI from the upper sideband. There is more information on running <tt>testautoflag</tt> in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4_(Caltech) this tutorial].<br />
<br />
== Credits ==<br />
<br />
The EVLA data was taken by A. Soderberg et al. as part of project AS1015. See <br />
[https://science.nrao.edu/enews/3.8/index.shtml#evlanoise NRAO eNews 3.8] (1-Sep-2010) for more on this result.<br />
<br />
<blockquote><i><br />
The Expanded Very Large Array (EVLA) is a partnership of the United States, Canada, and Mexico. The EVLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
SDSS image courtesy David Hogg & Michael Blanton, private communication. Data comes from<br />
SDSS DR7, see [http://adsabs.harvard.edu/abs/2009ApJS..182..543A Abazajian et. al 2009].<br />
<br />
<blockquote><i><br />
Funding for the SDSS and SDSS-II has been provided by the Alfred P. Sloan Foundation, the Participating Institutions, the National Science Foundation, the U.S. Department of Energy, the National Aeronautics and Space Administration, the Japanese Monbukagakusho, the Max Planck Society, and the Higher Education Funding Council for England. The SDSS Web Site is [http://www.sdss.org/].<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The SDSS is managed by the Astrophysical Research Consortium for the Participating Institutions. The Participating Institutions are the American Museum of Natural History, Astrophysical Institute Potsdam, University of Basel, University of Cambridge, Case Western Reserve University, University of Chicago, Drexel University, Fermilab, the Institute for Advanced Study, the Japan Participation Group, Johns Hopkins University, the Joint Institute for Nuclear Astrophysics, the Kavli Institute for Particle Astrophysics and Cosmology, the Korean Scientist Group, the Chinese Academy of Sciences (LAMOST), Los Alamos National Laboratory, the Max-Planck-Institute for Astronomy (MPIA), the Max-Planck-Institute for Astrophysics (MPA), New Mexico State University, Ohio State University, University of Pittsburgh, University of Portsmouth, Princeton University, the United States Naval Observatory, and the University of Washington.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15611EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T17:54:02Z<p>Knyland: /* Gain calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 1), iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
field = '1', iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
field = '1', iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15610EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T17:50:57Z<p>Knyland: /* Gain calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*', spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.K0','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of amplitude and phase versus time, iterating over each antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15609EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T17:46:33Z<p>Knyland: /* Delay and Bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15608EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T17:45:42Z<p>Knyland: /* Bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Delay and Bandpass calibration ===<br />
<br />
<br />
<br />
We will follow a similar procedure as the one outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]].)<br />
<br />
As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency. for the calibrator sources in {{plotms}}.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We use our bright bandpass calibrator, 3C147, to calibrate the delays:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.K0',<br />
spw='2~3,5~6:4~59', solint='inf', refant='ea24', <br />
gaintype='K', combine='scan', minsnr=3, <br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'])<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -3 to 5 nanoseconds.<br />
<br />
Now let's solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2','G55.7+3.4_10s.K0'],<br />
interp=['', 'nearest', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spws due to the way in which amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192&diff=15607EVLA 3-bit Tutorial G1922014-02-10T17:24:19Z<p>Knyland: /* Calibrating delays and bandpass */</p>
<hr />
<div>This is an Advanced EVLA data reduction tutorial that calibrates and images a 6-cm wide-band continuum dataset.<br />
<br />
<b>This casaguide is for Version 4.2.0 of CASA.</b><br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of a single-pointing 6-cm EVLA wideband continuum dataset of the galaxy NGC2967 (UGC5180) which was the location of the supernova candidate SN2010FZ. No supernova was detected in this observation, but the galactic continuum emission from this face-on spiral is nicely imaged. The data were taken in with 1024 MHz of bandwidth in each of two widely spaced basebands (each comprised of 8 128-MHz spectral windows), spanning 4.5 to 7.5 GHz. We will use wideband imaging techniques in this tutorial.<br />
<br />
This is a more advanced tutorial, and if you are a relative novice (and <em>particularly</em> for EVLA continuum calibration and imaging), it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before tackling this dataset. We will not include basic information on CASA processing in this tutorial.<br />
<br />
From the [http://casaguides.nrao.edu MainPage] of this guide you can find helpful information:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g. as lists for flags) outside the function call so make sure you<br />
set those before running the task command. Note that when you call a CASA task as a function the task parameters you<br />
do not set in the function call (assuming there is at least one) will be set to their defaults, and will not use values<br />
you set in previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more <br />
on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult,<br />
go ahead and widen the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the EVLA under program AS1015 as the scheduling block (SB) <tt>AS1015_sb1658169_1.55388.89474846065</tt>, and was run on 2010-07-11 from 21:28 to 22:28 UT (size 37.74GB). <br />
<br />
The data can be directly downloaded from [http://casa.nrao.edu/Data/EVLA/SN2010FZ/SN2010FZ_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/SN2010FZ/SN2010FZ_10s.ms.tar.gz] (dataset size: 2.9 GB). For example, in you Linux terminal:<br />
<br />
<source lang="bash"><br />
wget http://casa.nrao.edu/Data/EVLA/SN2010FZ/SN2010FZ_10s.ms.tar.gz<br />
</source><br />
<br />
Your first step will be to unzip and untar the file in a terminal, before you start CASA:<br />
<br />
<source lang="bash"><br />
tar -xzvf SN2010FZ_10s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data straight from the EVLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for project **AS1015**. Then select the <tt>AS1015_sb1658169_1.55388.89474846065</tt> dataset and choose to apply the online flags (check box "Apply flags generated during observing") and time-averaging of 10 seconds. (The data were taken in D-configuration [max baselines 1km], so one can safely average to 3s or even 10s to reduce dataset size.) Also select the tar option. This will create a file equivalent to what is used at the workshop.<br />
<br />
== Starting CASA ==<br />
<br />
{{CaltechCASAStartup}}<br />
<br />
== Examining the MS ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('SN2010FZ_10s.ms')<br />
</source><br />
<br />
In the logger you should see:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
<br />
================================================================================<br />
MeasurementSet Name: SN2010FZ_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Alicia M. Soderberg Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 1570726 Total integration time = 3359 seconds<br />
Observed from 11-Jul-2010/21:30:44.0 to 11-Jul-2010/22:26:43.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
11-Jul-2010/21:30:44.0 - 21:30:52.0 2 0 J0925+0019 404 6.43 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:31:02.0 - 21:32:22.0 3 0 J0925+0019 5062 9.68 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:32:32.0 - 21:33:52.0 4 0 J0925+0019 6277 9.91 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:34:02.0 - 21:34:52.0 5 0 J0925+0019 4148 9.96 [0, 1] CALIBRATE_PHASE#UNSPECIFIED<br />
21:35:02.0 - 21:35:51.5 6 0 J0925+0019 32640 9.44 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
21:36:01.0 - 21:38:20.5 7 0 J0925+0019 81600 9.93 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
21:38:44.0 - 21:39:51.0 9 1 SN2010FZ 43520 9.16 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:40:01.0 - 21:41:20.5 10 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:41:30.0 - 21:42:50.0 11 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:43:00.0 - 21:44:20.0 12 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:44:30.0 - 21:45:50.0 13 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:46:00.0 - 21:47:19.5 14 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:47:29.0 - 21:47:49.0 15 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:48:12.0 - 21:49:18.5 16 0 J0925+0019 43520 9 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
21:49:42.0 - 21:50:49.0 17 1 SN2010FZ 43520 9.17 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:50:59.0 - 21:52:19.0 18 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:52:29.0 - 21:53:48.5 19 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:53:58.0 - 21:55:18.0 20 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:55:28.0 - 21:56:48.0 21 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:56:58.0 - 21:58:18.0 22 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:58:28.0 - 21:58:47.5 23 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
21:59:10.5 - 22:00:17.0 24 0 J0925+0019 43520 8.99 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
22:00:39.5 - 22:01:47.0 25 1 SN2010FZ 43520 9.18 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:01:57.0 - 22:03:17.0 26 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:03:27.0 - 22:04:47.0 27 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:04:57.0 - 22:06:16.5 28 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:06:26.0 - 22:07:46.0 29 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:07:56.0 - 22:09:16.0 30 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:09:26.0 - 22:09:45.5 31 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:10:08.0 - 22:11:15.5 32 0 J0925+0019 43520 9.13 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
22:11:38.0 - 22:12:45.5 33 1 SN2010FZ 43520 9.19 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:12:55.0 - 22:14:15.0 34 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:14:25.0 - 22:15:45.0 35 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:15:55.0 - 22:17:15.0 36 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:17:25.0 - 22:18:44.5 37 1 SN2010FZ 48960 9.89 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:18:54.0 - 22:20:14.0 38 1 SN2010FZ 48960 10 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:20:24.0 - 22:20:43.5 39 1 SN2010FZ 16320 9.67 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED<br />
22:21:06.0 - 22:22:13.5 40 0 J0925+0019 42690 9.15 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED<br />
22:25:13.0 - 22:25:13.0 42 2 3C286 1028 2.87 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
22:25:23.0 - 22:26:43.0 43 2 3C286 47757 9.6 [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
(nVis = Total number of time/baseline visibilities per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nVis <br />
0 D J0925+0019 09:25:07.81503 +00.19.13.9334 J2000 0 303381 <br />
1 NONE SN2010FZ 09:42:04.77000 +00.19.51.0000 J2000 1 1218560<br />
2 K 3C286 13:31:08.28798 +30.30.32.9589 J2000 2 48785 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (18 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 7686 2000 128000 RR RL LR LL <br />
1 64 TOPO 7836 2000 128000 RR RL LR LL <br />
2 64 TOPO 4488 2000 128000 RR RL LR LL <br />
3 64 TOPO 4616 2000 128000 RR RL LR LL <br />
4 64 TOPO 4744 2000 128000 RR RL LR LL <br />
5 64 TOPO 4872 2000 128000 RR RL LR LL <br />
6 64 TOPO 5000 2000 128000 RR RL LR LL <br />
7 64 TOPO 5128 2000 128000 RR RL LR LL <br />
8 64 TOPO 5256 2000 128000 RR RL LR LL <br />
9 64 TOPO 5384 2000 128000 RR RL LR LL <br />
10 64 TOPO 6488 2000 128000 RR RL LR LL <br />
11 64 TOPO 6616 2000 128000 RR RL LR LL <br />
12 64 TOPO 6744 2000 128000 RR RL LR LL <br />
13 64 TOPO 6872 2000 128000 RR RL LR LL <br />
14 64 TOPO 7000 2000 128000 RR RL LR LL <br />
15 64 TOPO 7128 2000 128000 RR RL LR LL <br />
16 64 TOPO 7256 2000 128000 RR RL LR LL <br />
17 64 TOPO 7384 2000 128000 RR RL LR LL <br />
Sources: 50<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 J0925+0019 0 - - <br />
0 J0925+0019 1 - - <br />
0 J0925+0019 2 - - <br />
0 J0925+0019 3 - - <br />
0 J0925+0019 4 - - <br />
0 J0925+0019 5 - - <br />
0 J0925+0019 6 - - <br />
0 J0925+0019 7 - - <br />
0 J0925+0019 8 - - <br />
0 J0925+0019 9 - - <br />
0 J0925+0019 10 - - <br />
0 J0925+0019 11 - - <br />
0 J0925+0019 12 - - <br />
0 J0925+0019 13 - - <br />
0 J0925+0019 14 - - <br />
0 J0925+0019 15 - - <br />
0 J0925+0019 16 - - <br />
0 J0925+0019 17 - - <br />
1 SN2010FZ 2 - - <br />
1 SN2010FZ 3 - - <br />
1 SN2010FZ 4 - - <br />
1 SN2010FZ 5 - - <br />
1 SN2010FZ 6 - - <br />
1 SN2010FZ 7 - - <br />
1 SN2010FZ 8 - - <br />
1 SN2010FZ 9 - - <br />
1 SN2010FZ 10 - - <br />
1 SN2010FZ 11 - - <br />
1 SN2010FZ 12 - - <br />
1 SN2010FZ 13 - - <br />
1 SN2010FZ 14 - - <br />
1 SN2010FZ 15 - - <br />
1 SN2010FZ 16 - - <br />
1 SN2010FZ 17 - - <br />
2 3C286 2 - - <br />
2 3C286 3 - - <br />
2 3C286 4 - - <br />
2 3C286 5 - - <br />
2 3C286 6 - - <br />
2 3C286 7 - - <br />
2 3C286 8 - - <br />
2 3C286 9 - - <br />
2 3C286 10 - - <br />
2 3C286 11 - - <br />
2 3C286 12 - - <br />
2 3C286 13 - - <br />
2 3C286 14 - - <br />
2 3C286 15 - - <br />
2 3C286 16 - - <br />
2 3C286 17 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
7 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
8 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
9 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
10 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
11 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
12 ea14 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA, for a total integration of 3359 seconds (1 hour). The number of data records (1570726) is equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 351 baselines (27X26/2) X 360 integrations (3600s total/10s avg) X 16 spectral windows = 2021760. Note that this is high by ~30%; this is because the archive already flagged bad data, and there are some scans which only have two (rather than 16) spectral windows present. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. <br />
<br />
From the spectral window information, we can see that there were a total of 18 (0 through 17) spectral windows in this dataset. The first two of these (0 and 1) were only used to help set up the correlator. <br />
<br />
Looking at the scan listing, we can see that the first four scans which are present used only these spectral windows. These are referred to as "dummy scans". We will not be using these, since they often contain bad data. <br />
<br />
The C-band data of interest is contained in scans 6-44 and spectral windows 2 to 17. Careful examination shows that scan 8 is missing but from the time ranges that the data has been merged into scan 7. This sort of correlator back-end data-capture issue was occasionally seen during 2010. Hopefully, it will not affect our data, but we should keep an eye out for problems with scan 7. <br />
<br />
The field listing shows three sources: <br />
<br />
* J0925+0019 (also referred to by its field ID, 0), which will serve as a calibrator for the visibility phases, <br />
* SN2010FZ (1), our science target field, and <br />
* 3C286 (2), which will serve as a calibrator for the visibility amplitudes, i.e., it is assumed to have a precisely known flux density; as well as the spectral bandpass.<br />
<br />
== Flagging the MS ==<br />
<br />
The online flags, which are a record of known bad data produced by the EVLA online system, have already been applied by the archive as it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is also stored in a separate table in the MS, called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>SN2010FZ_10s.ms</tt>.)<br />
<br />
[[Image:PlotSN2010FZ_flagcmd_3.4.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}.<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='SN2010FZ_10s.ms',inpmode='table',action='list')<br />
</source><br />
These will go to the logger or terminal (they appear to go to the terminal now in 4.2).<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(285)<br />
flagcmd(vis='SN2010FZ_10s.ms',inpmode='table',action='plot',tablerows=myrows)<br />
</source><br />
<br />
Note that we are only plotting the first 285 rows -- this is because the last few are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. Note that you can not do the <tt>tablerows</tt> selection and plot those too, you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
This will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='SN2010FZ_10s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
plotfile='PlotSN2010FZ_flagcmd_4.2.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. <br />
They are color-coded by REASON, and you see ANTENNA_NOT_ON_SOURCE flags between scans, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after band changes when the subreflector rotates to <br />
pick up the new feed on the ring, some are slower than others). What you watch for here are long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags.<br />
<br />
[[Image:plotSN2010FZ_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('SN2010FZ_10s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs.X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of plotms.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting so most box/flag operations would not get rid of all the bad data. <br />
<br />
We will instead use plotms to identify bad data and then use flagcmd to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imaging spending a day flagging your data, then a disk error corrupts the MS. It's imperative that you have an automated way to regenerate your work. This is also why we encourage you to keep a running file with all the commands you use on a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that gets rid of boxes you have drawn. Be careful and don't hit the '''Flag''' button by mistake!<br />
<br />
As we found above, the useful spectral windows are 2-17. To get an idea of the data layout, plot a single baseline (ea01&ea02) and channel (31, for all spectral windows) versus time:<br />
<br />
[[Image:screenshotPlotSN2010FZ_plotms_ants1_4.0.png|200px|thumb|right|plotms ea01&ea02 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='',spw='2~17:31~31', \<br />
antenna='ea01&ea02',correlation='RR,LL',xaxis='time',yaxis='amp')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) flux calibrator at the end of the observation. Feel free to play with ways to view, or color the data: for example, go to the "Display" left-hand tab, and choose "Colorize by: Field". You can also change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style".<br />
<br />
[[Image:screenshotPlotSN2010FZ_plotms_ants2_4.0.png|200px|thumb|right|plotms ea01 for field 2 showing amp versus ANTENNA2]]<br />
Look for bad antennas by picking the last field and plotting baselines versus antenna <tt>ea01</tt>:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17:31~31', \<br />
antenna='ea01',correlation='RR,LL',xaxis='antenna2',yaxis='amp')<br />
</source><br />
<br />
You should be able to see that antenna 11 (= ea13) is bad (very low amplitude, it has no C-band receiver!) and that some of the spectral windows on 15 and 23 (ea17, ea25) are also on the low side. Boxing with the '''Mark Regions''' [[Image:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that spw 10-17 are suspect for these antennas. (Note: you may also leave these in for now if you like; if this were truly a first pass through the data it is unlikely that they would be caught. Since this is a tutorial, and there is limited time for a second pass through the data, it's probably best to trust us and delete them now.)<br />
<br />
[[Image:plotSN2010FZ_plotms_ea02.png|200px|thumb|right|plotms field 2 ea02 amp vs frequency]]<br />
Now look at the bandpass for ea02 - it is in the inner core and a prospective reference antenna. Exclude ea13 using negation (represented by "!") in the selection:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17', \<br />
antenna='ea02;!ea13',correlation='RR,LL',xaxis='frequency',yaxis='amp')<br />
</source><br />
There is clearly less data for spw 11, and use of Locate shows spw 11 data only for ea02,ea03,04,08,09,11,12. We will later delete this incomplete spw. Note also the very strong RFI spike at 6614 MHz (spw 10 ch 63) with clear ringing contaminating both spw 10 and 11. There is also a tremendous roll-off in spw 10. We will drop these spectral window when we process the data.<br />
<br />
[[Image:plotSN2010FZ_plotms_ea02ea20.png|200px|thumb|right|plotms ea02 iteration with baseline stopped at ea02&ea20 showing phase vs frequency]]<br />
We can also step through the baselines to our antenna using iteraxis:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',iteraxis='baseline')<br />
</source><br />
and use the '''Next Iteration''' [[Image:NextIterationButton.png]] button to step through the baselines.<br />
This will make it easier to isolate the bad antennas. Now plot the phases, iterating through baselines to ea02:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='phase',iteraxis='baseline')<br />
</source><br />
You see the slopes due to residual delays. Mostly a turn or less over a 128MHz subband, but there are some outliers.<br />
Step through to ea20. You see that there is a very large delay in RR (via locate) for<br />
the first baseband (spw 0~7). We will delete this (will also delete LL so there are no orphan polarization products, which would be ignored by {{clean}} in the imaging stage).<br />
Note ea17 and ea25 baselines drop close to zero in the middle of upper baseband (e.g. plot 'ea17&ea25') so we will delete these.<br />
<br />
To carry out flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea13"',<br />
'antenna="ea17" spw="10~17"',<br />
'antenna="ea25" spw="10~17"',<br />
'antenna="ea20" spw="2~9"']<br />
flagcmd(vis='SN2010FZ_10s.ms',inpmode='list',inpfile=flaglist,action='apply',flagbackup=True)<br />
</source><br />
These commands will be carried out as well as being added to the FLAG_CMD table (marked as applied).<br />
<br />
Plot the data again, now that is has been flagged:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='',spw='5:30~33',avgchannel='64', \<br />
antenna='ea01&ea02',correlation='RR,LL',xaxis='time',yaxis='amp')<br />
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')<br />
</source><br />
<br />
[[Image:plotSN2010FZ_plotms_ea02fld0.png|200px|thumb|right|plotms field 0 ea02 amp vs frequency]]<br />
Now our phase calibrator - it is weaker, and we now start to really see the RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17',antenna='ea02', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')<br />
</source><br />
Use the Zoom feature, Mark rectangles and use Locate to identify the frequency/channel of RFI. In particular, we note in our analysis:<br />
* 6614MHz (spw 10 ch 63) super strong<br />
* 6772-6778MHz (spw 12 ch 14-17)<br />
* 7260-7264MHz (spw 16 ch 2-4)<br />
* 7314-7340MHz (spw 16 ch 29-42)<br />
* 7402-7418MHz (spw 17 ch 9-17)<br />
* 7458-7466MHz (spw 17 ch 37-41)<br />
* 7488MHz (spw 17 ch 52)<br />
<br />
If you plot all antennas and avoid the band edges you see spw 16 and 17 are pretty wiped out:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17:4~59',antenna='', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')<br />
</source><br />
<br />
For now we will not flag these spectral windows, but note the bad channels, which we will mask out when creating continuum calibration tables and images.<br />
<br />
Finally, split off the good scans and spw, this will allow us to work on the data without having to start completely over (if we mess something up badly) as well as letting us do simpler data selections. Note that we do not include spw 10, because of the bad RFI, or spw 11, because of the many missing antennas.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_flagged10s.ms')<br />
split(vis='SN2010FZ_10s.ms',outputvis='SN2010FZ_flagged10s.ms',datacolumn='data',spw='2~9,12~17',scan='7~43')<br />
</source><br />
<br />
You now have a MS called <tt>SN2010FZ_flagged10s.ms</tt> in your working area. This should be 2.8GB in size, which you can see while still at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh SN2010FZ_flagged10s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotSN2010FZ_plotms_datastream_zoomed.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot, zoomed in on last scan]]<br />
At this point it is useful to plot a "datastream" view of the dataset to show what antennas are present at what time. You can do this using<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='',correlation='RR,LL',<br />
timerange='',antenna='',spw='0:31',<br />
xaxis='time',yaxis='antenna2',<br />
plotrange=[-1,-1,0,26],coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines TO a given Antenna2 (which means there is no line for ea01 which is antenna 0). You can pick up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot, having zoomed in on the last scan on 3C286. You see here that some antennas are present in this scan earlier than others (e.g. ea02 comes in one 10s integration later than ea04).<br />
<br />
== Calibration ==<br />
<br />
Summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('SN2010FZ_flagged10s.ms')<br />
</source><br />
In the logger we see:<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
<br />
================================================================================<br />
MeasurementSet Name: SN2010FZ_flagged10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Alicia M. Soderberg Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 1375038 Total integration time = 3042 seconds<br />
Observed from 11-Jul-2010/21:36:01.0 to 11-Jul-2010/22:26:43.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
11-Jul-2010/21:36:01.0 - 21:38:20.5 7 0 J0925+0019 73710 9.93 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
21:38:44.0 - 21:39:51.0 9 1 SN2010FZ 39312 9.16 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:40:01.0 - 21:41:20.5 10 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:41:30.0 - 21:42:50.0 11 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:43:00.0 - 21:44:20.0 12 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:44:30.0 - 21:45:50.0 13 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:46:00.0 - 21:47:19.5 14 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:47:29.0 - 21:47:49.0 15 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:48:12.0 - 21:49:18.5 16 0 J0925+0019 39312 9 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
21:49:42.0 - 21:50:49.0 17 1 SN2010FZ 39312 9.17 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:50:59.0 - 21:52:19.0 18 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:52:29.0 - 21:53:48.5 19 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:53:58.0 - 21:55:18.0 20 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:55:28.0 - 21:56:48.0 21 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:56:58.0 - 21:58:18.0 22 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:58:28.0 - 21:58:47.5 23 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
21:59:10.5 - 22:00:17.0 24 0 J0925+0019 39312 8.99 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
22:00:39.5 - 22:01:47.0 25 1 SN2010FZ 39312 9.18 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:01:57.0 - 22:03:17.0 26 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:03:27.0 - 22:04:47.0 27 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:04:57.0 - 22:06:16.5 28 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:06:26.0 - 22:07:46.0 29 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:07:56.0 - 22:09:16.0 30 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:09:26.0 - 22:09:45.5 31 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:10:08.0 - 22:11:15.5 32 0 J0925+0019 39312 9.13 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
22:11:38.0 - 22:12:45.5 33 1 SN2010FZ 39312 9.19 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:12:55.0 - 22:14:15.0 34 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:14:25.0 - 22:15:45.0 35 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:15:55.0 - 22:17:15.0 36 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:17:25.0 - 22:18:44.5 37 1 SN2010FZ 44226 9.89 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:18:54.0 - 22:20:14.0 38 1 SN2010FZ 44226 10 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:20:24.0 - 22:20:43.5 39 1 SN2010FZ 14742 9.67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED<br />
22:21:06.0 - 22:22:13.5 40 0 J0925+0019 38584 9.15 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED<br />
22:25:13.0 - 22:25:13.0 42 2 3C286 924 2.88 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
22:25:23.0 - 22:26:43.0 43 2 3C286 43148 9.6 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED<br />
(nVis = Total number of time/baseline visibilities per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nVis <br />
0 D J0925+0019 09:25:07.81503 +00.19.13.9334 J2000 0 230230 <br />
1 NONE SN2010FZ 09:42:04.77000 +00.19.51.0000 J2000 1 1100736<br />
2 K 3C286 13:31:08.28798 +30.30.32.9589 J2000 2 44072 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (14 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 4488 2000 128000 RR RL LR LL <br />
1 64 TOPO 4616 2000 128000 RR RL LR LL <br />
2 64 TOPO 4744 2000 128000 RR RL LR LL <br />
3 64 TOPO 4872 2000 128000 RR RL LR LL <br />
4 64 TOPO 5000 2000 128000 RR RL LR LL <br />
5 64 TOPO 5128 2000 128000 RR RL LR LL <br />
6 64 TOPO 5256 2000 128000 RR RL LR LL <br />
7 64 TOPO 5384 2000 128000 RR RL LR LL <br />
8 64 TOPO 6744 2000 128000 RR RL LR LL <br />
9 64 TOPO 6872 2000 128000 RR RL LR LL <br />
10 64 TOPO 7000 2000 128000 RR RL LR LL <br />
11 64 TOPO 7128 2000 128000 RR RL LR LL <br />
12 64 TOPO 7256 2000 128000 RR RL LR LL <br />
13 64 TOPO 7384 2000 128000 RR RL LR LL <br />
<snip><br />
</pre><br />
Note that the spectral windows are re-numbered to 0 through 13.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibrating the data. The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which are then collectively applied to the science data. <br />
For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
Before calibrating, we insert a model for flux calibration source 3C286 into the MS. In order to do this, we first have to locate the model image on our system with {{setjy}}, which we will also use to set the flux density scale. The {{setjy}} task (in release 3.3.0 and later) has an option to list possible model images it knows about:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='SN2010FZ_flagged10s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation:<br />
<pre><br />
<br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /usr/lib64/casapy/release/4.2.0/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_S.im 3C147_K.im 3C147_X.im 3C286_Q.im 3C48_C.im 3C48_U.im<br />
3C138_C.im 3C138_U.im 3C147_L.im 3C286_A.im 3C286_S.im 3C48_K.im 3C48_X.im<br />
3C138_K.im 3C138_X.im 3C147_Q.im 3C286_C.im 3C286_U.im 3C48_L.im README<br />
3C138_L.im 3C147_A.im 3C147_S.im 3C286_K.im 3C286_X.im 3C48_Q.im<br />
3C138_Q.im 3C147_C.im 3C147_U.im 3C286_L.im 3C48_A.im 3C48_S.im<br />
</pre><br />
The relevant image for our purposes is <tt>3C286_C.im</tt>, in the directory <tt>/usr/lib64/casapy/release/data/nrao/VLA/CalModels</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since it knows about this image, we only have to give the image name and not the entire path. Otherwise, you will need to give it the entire path. We now run the task using this model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
mysetjy = setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, model='3C286_C.im', usescratch=False)<br />
</source><br />
<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We have not specified a Flux Density Scale Standard and are thus using the default (<tt>standard='Perley-Butler 2010'</tt>) as that was current when these observations were taken. In particular, there is a more recent "Perley-Butler 2013" scale that most users will want to use! See <tt>help setjy</tt> for more details.<br />
<br />
Inspecting the logger report shows that 3C286 is about 7.7 Jy at lower end of the band to 5.7 Jy at the upper end.<br />
<br />
Note: With release 4.2 {{setjy}} now returns a dictionary to Python, which we have captured in a variable. This can be used in scripts.<br />
<br />
=== Deriving pre-determined calibrations: antenna position corrections, gain-elevation curves, and requantizer gains ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, and requantizer gains.<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the time they were determined and when they were applied by the observing system, compared to the times in your observations.<br />
<source lang="python"><br />
# In CASA<br />
gencal('SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.antpos',caltype='antpos',antenna='')<br />
</source><br />
You should see in the logger:<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea01 : 0.00000 0.00300 0.00000<br />
offsets for antenna ea02 : -0.00080 0.00000 0.00000<br />
offsets for antenna ea03 : -0.00280 0.00000 0.00000<br />
offsets for antenna ea05 : 0.00000 0.00280 0.00000<br />
offsets for antenna ea06 : 0.00220 0.00100 0.00590<br />
offsets for antenna ea10 : 0.00080 0.00300 -0.00140<br />
offsets for antenna ea11 : 0.00090 0.00000 0.00000<br />
offsets for antenna ea12 : -0.00280 0.00000 0.00000<br />
offsets for antenna ea13 : 0.00000 -0.00080 0.00000<br />
offsets for antenna ea17 : -0.00120 0.00000 0.00000<br />
offsets for antenna ea18 : 0.00040 -0.00080 0.00040<br />
offsets for antenna ea22 : -0.00370 -0.00130 0.00000<br />
offsets for antenna ea23 : -0.00140 0.00000 0.00000<br />
offsets for antenna ea24 : -0.00150 0.00000 0.00000<br />
offsets for antenna ea26 : -0.00190 0.00000 0.00210<br />
offsets for antenna ea27 : 0.00000 0.00190 -0.00160<br />
</pre><br />
Note that there are significant position corrections for a number of the antennas. <br />
<br />
In CASA 4.1, we now have the option to use {{gencal}} to create a calibration table containing the gain curves for the antennas. Although you can still use the <tt>gaincurve=True</tt> option in each task, we will make use of this new feature (note that the <tt>gaincurve=True</tt> will be phased out in future CASA releases):<br />
<source lang="python"><br />
# In CASA<br />
gencal('SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.gaincurve',caltype='gc')<br />
</source><br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data (and our SN2010FZ is 8-bit), we include it here for completeness. It will not affect the calibration for our 8-bit data, but if one is following this CASA Guide as a template for 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration.<br />
<source lang="python"><br />
# In CASA<br />
gencal('SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.requantizer',caltype='rq')<br />
</source><br />
<br />
Since we're running {{gencal}} on 3-bit data, it logs that it found "0 TIME/SPW switched power samples."<br />
<br />
The caltables we have generated -- <tt>calSN2010FZ.antpos</tt>, <tt>calSN2010FZ.gaincurve</tt>, and <tt>calSN2010FZ.requantizer</tt> -- will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and bandpass ===<br />
<br />
[[Image:plotSN2010FZ_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotSN2010FZ_plotcal_delays_4.2.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotSN2010FZ_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant 16~26]]<br />
[[Image:plotSN2010FZ_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant 16~26]]<br />
[[Image:plotSN2010FZ_plotcal_B0ea14_4.0.png|200px|thumb|right|plotcal B0 amp and phase vs. freq for ea14]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels in each spw on the bandpass/flux calibrator 3c286 to flatten them before solving for the bandpass. Note where we saw RFI in the higher spw and avoid those channels. The range 23~28 should work. Pick a refant near center - ea04 is a reasonable bet (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G0',field='2',spw='0~13:23~28', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve'],\<br />
gaintype='G',refant='ea04',calmode='p',solint='int',minsnr=3) <br />
</source><br />
<br />
* <tt>refant='ea04'</tt> : try to use ea04 as the reference antenna<br />
* <tt>solint='int'</tt> : do a per-integration solve (every 10 seconds, since we've time-averaged the data)<br />
* <tt>minsnr=3</tt> : apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged<br />
* <tt>gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve']</tt> : pre-apply the antpos and gaincurve caltables<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the caltable in another task, use the Quit button on the GUI to dismiss the plotter and free up the lock on the caltable. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page multipanel plots (like those shown to the right), particularly for a<br />
hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase', \<br />
antenna='0~10,12~15',subplot=531,iteration='antenna', \<br />
plotrange=[-1,-1,-180,180],showgui=False,fontsize=6.0, \<br />
figfile='plotSN2010FZ_plotcal_G0p1.png')<br />
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase', \<br />
antenna='16~26',subplot=531,iteration='antenna', \<br />
plotrange=[-1,-1,-180,180],showgui=False,fontsize=6.0, \<br />
figfile='plotSN2010FZ_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual antenna-based delays that we saw in phase vs. frequency.<br />
This uses the gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,<br />
but instead does a baseline-based delay solution to all baselines to the refant, treating these<br />
as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions<br />
this will suffice. We avoid the beginning of spw 0 due to the extreme roll-off (with loss of S/N) at the<br />
starting edge.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.K0',\<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.G0'],\<br />
field='2',spw='0:8~59,1~13:4~59',gaintype='K', \<br />
refant='ea04',combine='scan',solint='inf',minsnr=3)<br />
</source><br />
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.<br />
We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each subband and polarization):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -6 to 6 nanoseconds.<br />
<br />
Now solve for the bandpass using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve', \<br />
'calSN2010FZ.G0','calSN2010FZ.K0'], \<br />
field='2',refant='ea04',solnorm=False, \<br />
bandtype='B', combine='scan', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
between spw due to how amplitude scaling adjusts weights internally during solving.<br />
<br />
You will see in the terminal some reports of solutions failing below our default S/N>3 cutoff:<br />
<pre><br />
32 of 50 solutions flagged due to SNR < 3 in spw=0 (chan=1) at 2010/07/11/22:26:05.4<br />
44 of 50 solutions flagged due to SNR < 3 in spw=0 (chan=0) at 2010/07/11/22:26:05.4<br />
</pre><br />
<br />
These are in the first two edge channels of the first spw where the response is low, and not unexpected. <br />
In the logger you will also see reports of reference antennas jumping in those channels, which can be <br />
be safely ignored (we will drop those channels later anyway).<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calSN2010FZ.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>). If we were at higher frequency we would also have made an opacity caltable (or set <tt>opacity</tt>).<br />
<br />
Now plot this, in amplitude then phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp',iteration='antenna')<br />
#<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
or to plot them all together<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp',<br />
antenna='0~10,12~15',subplot=531,iteration='antenna',<br />
fontsize=6.0, figfile='plotSN2010FZ_plotcal_B0a1_4.2.png')<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp',<br />
antenna='16~26',subplot=531,iteration='antenna',<br />
fontsize=6.0, figfile='plotSN2010FZ_plotcal_B0a2_4.2.png')<br />
#<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase',<br />
antenna='0~10,12~15',subplot=531,iteration='antenna',<br />
plotrange=[-1,-1,-180,180],fontsize=6.0, <br />
figfile='plotSN2010FZ_plotcal_B0p1_4.2.png')<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase',<br />
antenna='16~26',subplot=531,iteration='antenna',<br />
plotrange=[-1,-1,-180,180],fontsize=6.0, <br />
figfile='plotSN2010FZ_plotcal_B0p2_4.2.png')<br />
</source><br />
(this can take a long time to plot).<br />
<br />
In the bandpass phase you no longer see the residual antenna delays (just residual spw phase offsets from <br />
the delay solution registration) but there are some band edge effects.<br />
Note that some antennas have a little strange bandpasses at upper end of lower baseband in spw 5,6,7<br />
(e.g. ea14,ea16,ea17,ea25).<br />
To plot amp and phase for a single antenna versus frequency (see plots at right):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp', \<br />
antenna='ea14',subplot=211)<br />
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase', \<br />
antenna='ea14',subplot=212,plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Because our flux density calibrator 3C286 is bright enough, we were able to use this as the bandpass calibrator.<br />
Since {{setjy}} put the correct spectrum for 3C286 into the MODEL_DATA column, our bandpass will reflect the<br />
true bandpass of the instrument. However, if for your observation you were unable to use a source of known spectrum <br />
as the bandpass calibrator, then you would need to use the output of {{fluxscale}} later on to bootstrap a {{setjy}} <br />
on your bandpass source using the derived spectral index information.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotSN2010FZ_plotcal_G1intp1_4.0.png|200px|thumb|right|plotcal G1int per-int phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G1intp2_4.0.png|200px|thumb|right|plotcal G1int per-int phase ant 16~26]]<br />
<br />
[[Image:plotSN2010FZ_plotcal_G1intp_ea01_4.0.png|200px|thumb|right|plotcal G1int per-int phase ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G1infp_ea01_4.0.png|200px|thumb|right|plotcal G1inf per-scan phase ant 0~15]]<br />
<br />
Now calibrate phases using the full bandwidth. <br />
First both our calibrators, one at a time - we could do them together, but in general you might need<br />
to do different solution intervals for each, so we keep the runs separate to illustrate how to <br />
do separate solutions and append them.<br />
We exclude RFI channels here, and obtain one solution per integration (these are bright enough):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1int', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0'], \<br />
field='2',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='int',gaintype='G',calmode='p')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1int', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='int',gaintype='G',calmode='p',append=True)<br />
</source><br />
These will get applied when solving for amplitudes, and when calibrating the calibrators themselves.<br />
<br />
The phases look reasonably connected:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G1int',xaxis='time',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we make a second table with one solution on our gain calibrator per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1inf',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',gaintype='G',calmode='p')<br />
</source><br />
These scan phases will get interpolated by {{applycal}} onto our target. These look good also:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G1inf',xaxis='time',yaxis='phase',iteration='antenna', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now solve for amplitudes on a per scan interval, after applying the per-integration phases. <br />
Do these separately using <tt>gainfield</tt> so phases don't get<br />
transferred across fields. For field 2 (3C286) we use <tt>combine='scan'</tt> as there are two scans <br />
on this source, with the first one having much less data (and will thus give a noisy solution on its own).<br />
Note that {{gaincal}} uses linear interpolation of the previously determined phases by default, so <br />
set this to "nearest" if you want to override this.<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'], \<br />
gainfield=['','','2','2','2'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='2',refant='ea04',solnorm=F,<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'],\<br />
gainfield=['','','2','2','0'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',gaintype='G',calmode='a',append=True)<br />
</source><br />
This is the table we will apply to the data.<br />
<br />
[[Image:plotSN2010FZ_plotcal_G2infa1_4.0.png|200px|thumb|right|plotcal G2 per-scan amp ant 0~15]]<br />
[[Image:plotSN2010FZ_plotcal_G2infa2_4.0.png|200px|thumb|right|plotcal G2 per-scan amp ant 16~26]]<br />
<br />
We do a second version of the amplitude calibration, this time using <tt>combine='scan'</tt> on field 0. This is <br />
to use for input to {{fluxscale}} in the next step.<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G3', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'], \<br />
gainfield=['','','2','2','2'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='2',refant='ea04',solnorm=F,<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G3', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1int'],\<br />
gainfield=['','','2','2','0'], \<br />
interp=['','','nearest','nearest','nearest'], \<br />
field='0',refant='ea04',solnorm=F, \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
solint='inf',combine='scan',gaintype='G',calmode='a',append=True)<br />
</source><br />
<br />
Since the flux on the gain calibrator is not scaled to its correct flux (but to 1.0 Jy by default),<br />
use {{fluxscale}} to transfer the amplitude gains from 3c286:<br />
<source lang="python"><br />
# In CASA<br />
myflux = fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G3', \<br />
fluxtable='calSN2010FZ.F3inc',reference='2',transfer='0',<br />
incremental=True)<br />
</source><br />
where we have captured the returned dictionary in the Python variable <tt>myflux</tt>. We have use the<br />
<tt>incremental=True</tt> option (new to CASA 4.0) to make this table contain only the scale factors <br />
per-antenna per-spw per-field needed to scale the data (rather than rescaling the input table). Thus it<br />
can be applied in addition to our <tt>G2</tt> table even though it was derived from the <tt>G3</tt> table.<br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C286<br />
Found transfer field(s): J0925+0019<br />
Flux density for J0925+0019 in SpW=0 (freq=4.488e+09 Hz) is: 0.977483 +/- 0.00278572 (SNR = 350.891, N = 50)<br />
Flux density for J0925+0019 in SpW=1 (freq=4.616e+09 Hz) is: 0.975972 +/- 0.00253876 (SNR = 384.429, N = 50)<br />
Flux density for J0925+0019 in SpW=2 (freq=4.744e+09 Hz) is: 0.978538 +/- 0.00242824 (SNR = 402.982, N = 50)<br />
Flux density for J0925+0019 in SpW=3 (freq=4.872e+09 Hz) is: 0.979278 +/- 0.00244155 (SNR = 401.088, N = 50)<br />
Flux density for J0925+0019 in SpW=4 (freq=5e+09 Hz) is: 0.981804 +/- 0.00219239 (SNR = 447.823, N = 50)<br />
Flux density for J0925+0019 in SpW=5 (freq=5.128e+09 Hz) is: 0.981478 +/- 0.00314805 (SNR = 311.773, N = 50)<br />
Flux density for J0925+0019 in SpW=6 (freq=5.256e+09 Hz) is: 0.985493 +/- 0.00343534 (SNR = 286.869, N = 50)<br />
Flux density for J0925+0019 in SpW=7 (freq=5.384e+09 Hz) is: 0.978491 +/- 0.00201807 (SNR = 484.865, N = 50)<br />
Flux density for J0925+0019 in SpW=8 (freq=6.744e+09 Hz) is: 0.959005 +/- 0.00260159 (SNR = 368.623, N = 48)<br />
Flux density for J0925+0019 in SpW=9 (freq=6.872e+09 Hz) is: 0.955123 +/- 0.00262785 (SNR = 363.462, N = 48)<br />
Flux density for J0925+0019 in SpW=10 (freq=7e+09 Hz) is: 0.954202 +/- 0.00281227 (SNR = 339.3, N = 48)<br />
Flux density for J0925+0019 in SpW=11 (freq=7.128e+09 Hz) is: 0.950797 +/- 0.00354085 (SNR = 268.522, N = 48)<br />
Flux density for J0925+0019 in SpW=12 (freq=7.256e+09 Hz) is: 0.94732 +/- 0.00391511 (SNR = 241.965, N = 48)<br />
Flux density for J0925+0019 in SpW=13 (freq=7.384e+09 Hz) is: 0.939356 +/- 0.00383532 (SNR = 244.922, N = 48)<br />
Fitted spectrum for J0925+0019 with fitorder=1: Flux density = 0.968048 +/- 0.00159415 (freq=5.74863 GHz) <br />
spidx=-0.0721976 +/- 0.00943577<br />
...<br />
</pre><br />
You may see slightly different numbers on your machine (and will see more extensive output). Note that "N" here is the number of antennas x the number of polarizations used for the calculations; in this case, there are 24 unflagged antennas and 2 polarizations. As of CASA 4.0, {{fluxscale}} now returns a fitted spectral index (and possibly curvature, e.g. if fitorder>1), which can be input to {{setjy}} if you want to use these derived fluxes for a model. <br />
<br />
As it so happens, the derived flux for J0925+0019 is about 1 Jy (you can plot up the raw amplitudes for fields 0,2 and convince yourself this is indeed true and not a bug). The spectrum rises a bit to peak in spw 6 then falls again. We will not use the fitted spectrum (setjy does not yet take fitorder>1) but will apply a incremental table in subsequent processing.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we actually apply all our accumulated calibration tables. We apply these to the <br />
calibration fields individually using the appropriate gainfields and interpolation for each:<br />
* For 3C286 (field 2) we did short-timescale phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
* For the nearby gain calibrator (field 0) we did only scan-based phase and amplitude solutions so we use "nearest" interpolation<br />
* For the target source we use field 0 to calibrate field 1, so use "linear" interpolation. This takes a few minutes.<br />
<br />
[[Image:plotSN2010FZ_plotms_applied_fld2.png|200px|thumb|right|plotms of 3C286 with calibration applied]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0',<br />
'calSN2010FZ.B0','calSN2010FZ.G1int','calSN2010FZ.G2'], \<br />
gainfield=['','','','','2','2'],<br />
interp=['','','nearest','nearest','nearest','nearest'], \<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0',<br />
'calSN2010FZ.B0','calSN2010FZ.G1int','calSN2010FZ.G2',<br />
'calSN2010FZ.F3inc'], \<br />
gainfield=['','','','','0','0','0'],<br />
interp=['','','nearest','nearest','nearest','nearest',''], \<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='1', \<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0',<br />
'calSN2010FZ.B0','calSN2010FZ.G1inf','calSN2010FZ.G2',<br />
'calSN2010FZ.F3inc'], \<br />
gainfield=['','','','','0','0','0'],<br />
interp=['','','nearest','nearest','linear','linear',''], \<br />
parang=False,calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will store the calibrated data.<br />
<br />
We can examine the corrected data on 3c286 using our RFI mask from above and avoiding band edges<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
See figure above right. There is clearly discrepant data visible spw 5 and 6, in particular for baseline ea17&ea25 (use the '''Mark Regions''' [[Image:MarkRegionsButton.png]] tool on some of it and then use the '''Locate''' [[File:casaplotms-locate-tool.png]] tool), which gives a really strange response. You can plot just this baseline to be sure:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
antenna='ea17&ea25', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
You can exclude this through antenna negation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
antenna='!ea17&ea25', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Then use '''Locate''' [[File:casaplotms-locate-tool.png]] for the other bad points, which seem to indicate spw 5,6,7 for ea14,ea16,ea17,ea25.<br />
Exclude these and replot:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
antenna='!ea14;!ea16;!ea17;!ea25', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld2.png|200px|thumb|right|plotms cal applied flagged fld2]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld2_phase.png|200px|thumb|right|plotms cal applied flagged fld2 phase]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_amp.png|200px|thumb|right|plotms cal applied flagged fld0 amp]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phase.png|200px|thumb|right|plotms cal applied flagged fld0 phase]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_amp_exc_4.0.png|200px|thumb|right|plotms cal applied flagged fld0 amp, with new spw selection]]<br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_ampavg_4.0.png|200px|thumb|right|plotms cal applied flagged fld0 amp averaged]]<br />
<br />
This now looks clean except for the RFI in the upper subbands.<br />
<br />
Do flagging based on these:<br />
<source lang="python"><br />
# In CASA<br />
flaglist2 = ['antenna="ea14,ea16,ea17,ea25" spw="5~7"']<br />
flagcmd(vis='SN2010FZ_flagged10s.ms',inpmode='list',inpfile=flaglist2,action='apply')<br />
</source><br />
<br />
Now replot the corrected data (you may have to force reload if you plotted same thing right before this):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Looks pretty good.<br />
<br />
Plot the phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')<br />
</source><br />
Note the characteristic "bowtie" pattern of the phases about the sub-band centers.<br />
Here we can see the effect of the EVLA "delay clunking", where the delay steps through discrete values such that<br />
the phase goes from -11deg to +11deg across the sub-band as the delay changes due to geometry. This is D-configuration so the delays change slowly, it will change faster in wider configurations. As of Q3 2011 we have not enabled the corrections for this in the EVLA system so you will always have this remaining delay error in your data. In principle, you could solve for delays on short timescales and take this out; in practice, this in not possible for your weaker science target source (where it would matter most for results).<br />
<br />
Now let's plot the corrected data amplitude for the phase calibrator (field 0):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:10~59,1~7:4~59,8:4~13;18~59,9~11:4~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
You can see the bandpass filter roll-off increasing the noise at the baseband edges (about 8-16 channels worth). Also, we can see some RFI we missed:<br />
* <6804 MHz spw 8 below ch 30 lots of bad stuff (a lot from ea18,ea22 but others too)<br />
* 7168 MHz spw 11 ch 20<br />
* pretty much all of spw 12,13<br />
The ch 20 ones are all harmonics of a notorious 128 MHz tone. NOTE: You can get the frequency of a RFI feature by looking at the logger report from using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool.<br />
<br />
We will not flag these, but exclude them in imaging (so that more advanced students can try flagging these in detail or using auto-flagging). A good channel selection string for imaging might be:<br />
<br />
<pre><br />
spw = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'<br />
</pre><br />
<br />
Without further flagging, it may be best to drop spw 12-13 for imaging (we will do so from now on).<br />
<br />
Plot again (including this selection for spw 0-11):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Looks better.<br />
<br />
Now plot amplitudes for the corrected data averaged over baseline to see the source spectrum:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0',<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59',<br />
correlation='RR,LL',avgbaseline=True,avgtime='60000s',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
The "custom" plotting parameters show how to control the symbol shape and size from the task.<br />
<br />
The last two sub-bands spw 12-13 give reasonable values, with only a tiny offset from spw 8-11.<br />
There are also strange amplitude excursions, particularly in the low end of the first baseband. These must be coming<br />
from one or more scans. You can iterate over scan to see the strange amplitudes (mostly from scan 7):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0',<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59,12:4~13;18~29;31~33;46~51;53~59,13:4~8;15~36;42~59',<br />
correlation='RR,LL',avgbaseline=True,avgtime='600s',iteraxis='scan',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
<br />
Also, there is an offset with the amplitudes for spw 6, perhaps due to the problem with baseline ea17&ea25 (which we flagged, but didn't recalibrate afterward) and likely affected the {{fluxscale}} solution. This is troubling enough that we will quickly go through a second round of calibration.<br />
<br />
== A Quick Recalibration ==<br />
<br />
We now go back and recalibrate the data. We may as well flag scan 7 first, as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='SN2010FZ_flagged10s.ms', scan='7')<br />
#<br />
# Clear the corrected data and model from header<br />
clearcal('SN2010FZ_flagged10s.ms',addmodel=False)<br />
#<br />
chanStr = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'<br />
#<br />
mysetjy2 = setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, modimage='3C286_C.im')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G0.2',field='2',spw='0~11:23~28',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve'],<br />
gaintype='G',refant='ea04',calmode='p',solint='int',minsnr=3)<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.K0.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.G0.2'],<br />
field='2', spw=chanStr, gaintype='K',<br />
refant='ea04', combine='scan', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.G0.2','calSN2010FZ.K0.2'],<br />
field='2',refant='ea04',solnorm=False,<br />
spw='0~11', <br />
bandtype='B', combine='scan', solint='inf')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2int',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2'],<br />
field='2',refant='ea04',solnorm=F, <br />
spw=chanStr,<br />
solint='int',gaintype='G',calmode='p')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2int',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='int',gaintype='G',calmode='p',append=True)<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2inf',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',gaintype='G',calmode='p')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','2'], <br />
interp=['','','nearest','nearest','nearest'],<br />
field='2',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','0'], <br />
interp=['','','nearest','nearest','nearest'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',gaintype='G',calmode='a',append=True)<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.3',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','2'],<br />
interp=['','','nearest','nearest','nearest'],<br />
field='2',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',combine='scan',gaintype='G',calmode='a')<br />
#<br />
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.3',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve',<br />
'calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2int'],<br />
gainfield=['','','2','2','0'], <br />
interp=['','','nearest','nearest','nearest'],<br />
field='0',refant='ea04',solnorm=F,<br />
spw=chanStr,<br />
solint='inf',combine='scan',gaintype='G',calmode='a',append=True)<br />
#<br />
myflux2 = fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G2.3',<br />
fluxtable='calSN2010FZ.F2.3inc',reference='2',transfer='0',<br />
incremental=True)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='2',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2int','calSN2010FZ.G2.2'],<br />
gainfield=['','','','','2','2'],<br />
interp=['','','nearest','nearest','linear','nearest'],<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='0',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2int','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3inc'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','nearest','nearest',''],<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='1',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2inf','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3inc'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','linear','linear',''],<br />
parang=False,calwt=False)<br />
</source><br />
<br />
Note that we have set the variable <tt>chanStr</tt> for our channel selection; this makes the task commands shorter and easier to read.<br />
<br />
The {{fluxscale}} output this time around is slightly different to the last:<br />
<pre><br />
Found reference field(s): 3C286<br />
Found transfer field(s): J0925+0019<br />
Flux density for J0925+0019 in SpW=0 (freq=4.488e+09 Hz) is: 0.978946 +/- 0.00284837 (SNR = 343.686, N = 50)<br />
Flux density for J0925+0019 in SpW=1 (freq=4.616e+09 Hz) is: 0.978634 +/- 0.00264066 (SNR = 370.602, N = 50)<br />
Flux density for J0925+0019 in SpW=2 (freq=4.744e+09 Hz) is: 0.980438 +/- 0.00251668 (SNR = 389.575, N = 50)<br />
Flux density for J0925+0019 in SpW=3 (freq=4.872e+09 Hz) is: 0.980116 +/- 0.00255481 (SNR = 383.636, N = 50)<br />
Flux density for J0925+0019 in SpW=4 (freq=5e+09 Hz) is: 0.982175 +/- 0.00230804 (SNR = 425.545, N = 50)<br />
Flux density for J0925+0019 in SpW=5 (freq=5.128e+09 Hz) is: 0.979574 +/- 0.00269688 (SNR = 363.225, N = 42)<br />
Flux density for J0925+0019 in SpW=6 (freq=5.256e+09 Hz) is: 0.980193 +/- 0.00271312 (SNR = 361.279, N = 42)<br />
Flux density for J0925+0019 in SpW=7 (freq=5.384e+09 Hz) is: 0.98102 +/- 0.00249166 (SNR = 393.721, N = 42)<br />
Flux density for J0925+0019 in SpW=8 (freq=6.744e+09 Hz) is: 0.962693 +/- 0.00282815 (SNR = 340.397, N = 48)<br />
Flux density for J0925+0019 in SpW=9 (freq=6.872e+09 Hz) is: 0.960313 +/- 0.00285418 (SNR = 336.459, N = 48)<br />
Flux density for J0925+0019 in SpW=10 (freq=7e+09 Hz) is: 0.957056 +/- 0.00303716 (SNR = 315.116, N = 48)<br />
Flux density for J0925+0019 in SpW=11 (freq=7.128e+09 Hz) is: 0.953964 +/- 0.00378326 (SNR = 252.154, N = 48)<br />
Flux density for J0925+0019 in SpW=12 is: INSUFFICIENT DATA <br />
Flux density for J0925+0019 in SpW=13 is: INSUFFICIENT DATA <br />
Fitted spectrum for J0925+0019 with fitorder=1: Flux density = 0.973376 +/- 0.00118872 (freq=5.52174 GHz) <br />
spidx=-0.0573991 +/- 0.00778736201<br />
</pre><br />
<br />
The source spectrum plot now looks somewhat better:<br />
<br />
[[Image:plotSN2010FZ_plotms_reproc_fld0_ampavg_4.0.png|200px|thumb|right|plotms recalibrated applied flagged fld0 amp averaged]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',avgbaseline=True,avgtime='60000s',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
As you see in the figure to the right, there are still spectral window to window variations that deviate from a smooth spectrum. This is due to noise in the {{fluxscale}} median filter now used in CASA 4.0 (in this well-calibrated case, the old weighted means used by {{fluxscale}} in CASA3.4 behaved better). If we use {{plotcal}} to plot the solutions versus antenna<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calSN2010FZ.G2.3',xaxis='antenna',yaxis='amp',field='0',<br />
subplot=211,plotrange=[-1,-1,0.9,1.1])<br />
plotcal(caltable='calSN2010FZ.G2.3',xaxis='antenna',yaxis='amp',field='2',<br />
subplot=212,plotrange=[-1,-1,0.9,1.1],figfile='plotSN2010FZ_plotcal_G2.3_ampant.png')<br />
</source><br />
we see that there are variations that will enter into the medians. Some antennas are better behaved than others, for example ea12 (index 10) seems better than most.<br />
<br />
[[Image:plotSN2010FZ_plotcal_G2.3_ampant.png|200px|thumb|right|plotcal of G2.3 table, showing variation of solutions per antenna]]<br />
[[Image:screenshotPlotSN2010FZ_plotcal_fluxedit3_ea12.png|200px|thumb|right|plotcal of G2.3.ea12 table, marking all solutions but those for ea12 for flagging]]<br />
[[Image:screenshotPlotSN2010FZ_plotms_recalibrated3_EA12_fld0_amp_4.0.png|200px|thumb|right|plotms for fld 0 after application of F2.3.ea12 table]]<br />
Because we are applying an incremental correction for the flux scale, we have the latitude to change the caltable that goes into {{fluxscale}} to get a better result. For example, we can restrict the antennas that are used to derive the scale. Although there is not yet antenna selection in {{fluxscale}} itself, we can edit the caltable using {{plotcal}}. For example, make a copy of the G2.3 caltable and select only a single antenna:<br />
<source lang="python"><br />
# In CASA<br />
os.system('cp -rf calSN2010FZ.G2.3 calSN2010FZ.G2.3.ea12')<br />
plotcal(caltable='calSN2010FZ.G2.3.ea12',xaxis='antenna',yaxis='amp')<br />
</source><br />
In the plot to the right we show the GUI where we have boxed all but antenna ea12.<br />
Now we carry on with the {{fluxscale}} and {{applycal}}:<br />
<source lang="python"><br />
# In CASA<br />
myfluxEdit3 = fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G2.3.ea12',<br />
fluxtable='calSN2010FZ.F2.3.ea12',reference='2',transfer='0',<br />
incremental=True)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='0',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2int','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3.ea12'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','nearest','nearest',''],<br />
parang=False,calwt=False)<br />
#<br />
applycal(vis='SN2010FZ_flagged10s.ms',field='1',spw='0~11',<br />
gaintable=['calSN2010FZ.antpos','calSN2010FZ.gaincurve','calSN2010FZ.K0.2',<br />
'calSN2010FZ.B0.2','calSN2010FZ.G1.2inf','calSN2010FZ.G2.2',<br />
'calSN2010FZ.F2.3.ea12'],<br />
gainfield=['','','','','0','0','0'], <br />
interp=['','','nearest','nearest','linear','linear',''],<br />
parang=False,calwt=False)<br />
</source><br />
The results appear better:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',avgbaseline=True,avgtime='60000s',<br />
xaxis='frequency',yaxis='amp',ydatacolumn='corrected',<br />
customsymbol=True,symbolshape='circle',symbolsize=2)<br />
</source><br />
Note that if you choose a different antenna than ea12 to use for this, you will get<br />
different results, usually worse. But this procedure illustrates how to use the<br />
incremental solutions from {{fluxscale}} to your possible advantage.<br />
<br />
We now return to examining our calibration.<br />
<br />
We can also plot the corrected phase - looks good:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')<br />
</source><br />
<br />
We can average over baseline and each scan:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',avgbaseline=True,avgtime='600s',<br />
xaxis='frequency',yaxis='phase',ydatacolumn='corrected')<br />
</source><br />
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phaseavg.png|200px|thumb|right|plotms cal applied flagged fld0 phase averaged]]<br />
<br />
In this case, we can see the residual effect of the EVLA "delay clunking" described above, but it is reduced due to the averaging that we applied, but it is still there.<br />
<br />
You can look at the target source field='1', but there are lots of data so you will need to do a lot of averaging.<br />
For example:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='SN2010FZ_flagged10s.ms',field='1',avgtime='300s', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')<br />
</source><br />
<br />
Alas, the upper baseband still has lots of low level RFI.<br />
<br />
Now split off the data for calibrators and target, to avoid later issues that can corrupt the MSs. We don't keep spw 12-15, since they weren't included in the last round of calibration, and we don't plan to image them.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_split10s.ms')<br />
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_split10s.ms', \<br />
datacolumn='corrected',field='1',spw='0~11')<br />
#<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_3c28610s.ms')<br />
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_3c28610s.ms', \<br />
datacolumn='corrected',field='2',spw='0~11')<br />
#<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf SN2010FZ_J092510s.ms')<br />
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_J092510s.ms', \<br />
datacolumn='corrected',field='0',spw='0~11')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
This is EVLA D-configuration data at C-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary_-_Current Observational Status Summary]:<br />
<br />
* Synthesized beam should be 12" at 6 GHz with primary beam field of view of 7.5 arcmin (450")<br />
<br />
Our data spans 4.5-7.5 GHz: this is a relatively large fractional bandwidth, resulting in substantial variation of the field of view over the entire frequency range. FOV = 45 arcmin / Frequency (GHz), giving 10 arcmin at 4.5 GHz, and 6 arcmin at 7.5 GHz. Likewise, the synthesized beam ranges from 16" at 4.5 GHz to 9.6" at 7.5 GHz. We want to subsample the synthesized beam by a factor of 3-4, so will use a cellsize of 3". To cover the full FOV (keeping it at the inner part of the image) at the lowest frequencies, we will want an image size of >400 pixels, or >20 arcmin.<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting,<br />
and will give reasonable resolution but will allow us to still see larger scale structure.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <br />
<tt>imsize</tt> should be composite number with two and only two prime factors chosen from<br />
2, 3, and 5. Taking into account the x1.2 padding that clean uses internally to the imsize<br />
you give it (and 1.2 = 2*3/5), we choose 640 or 1280 as our imsize (640 = 2^7*5). Other<br />
reasonable sets would be 405, 1215, etc. (405 = 3^4*5) or 432, 648, 1296 (these are 2^n*3^m*5).<br />
In practice, if you give it non-optimal values for imsize, you may find that the transforms<br />
take a bit longer, which is noticeable if you are doing interactive clean.<br />
<br />
WARNING: By default, a single-field nterms=1 clean does NOT use Cotton-Schwab (CS) clean to break<br />
into major cycles going back to data residuals, it just does cleaning in a bunch of minor<br />
cycles in the image plane. This can give much poorer imaging quality in cases with poor<br />
uv coverage (snapshots) or in the case of complex emission structure (like ours) -- clean tends to<br />
diverge in this case. You should explicitly set <tt>imagermode='csclean'</tt> in your<br />
call to clean. Also, in our case the psf is very good using mfs, so by default it will not<br />
take many major cycle breaks. We use the <tt>cyclefactor</tt> parameter to control this, which<br />
sets the break threshold to be cyclefactor times the max psf sidelobe level (outside the main<br />
peak). We start at <tt>cyclefactor=1.5</tt> in a single spw, and ratchet it up to 4.5 when we<br />
clean all the spw. This seems to work ok. Rule of thumb is if it is gobbling up many hundreds of<br />
clean iterations in the minor cycles early on, increase cyclefactor. Conversely, if your psf is poor<br />
but you source structure is simple, you can reduce cyclefactor (e.g. below 1) to stop it from taking<br />
lots of extra major cycles.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see<br />
[[EVLA_Continuum_Tutorial_3C391#Imaging]]. WARNING: In CASA 4.0 the GUI interface for clean <br />
and the viewer has changed slightly. Some of the screenshots shown below may differ slightly <br />
from what you see.<br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[[EVLA_6-cm_Wideband_Tutorial_SN2010FZ_(Caltech)#Cleaning_the_lower_baseband_using_two_MFS_Taylor_terms]] <br />
and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one of the lower baseband spw (spw 5 in this example).<br />
NOTE: this first time will take a few minutes at start to create scratch columns<br />
in the MS in case we want to do self-calibration later.<br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
[[Image:viewSN2010FZ_spw5_clean640_4.0.png|200px|thumb|right|interactive clean spw5 640x640 after around 1000 iterations]]<br />
[[Image:viewSN2010FZ_spw5_clean1280.png|200px|thumb|right|2nd interactive clean spw5 1280x1280 before cleaning]]<br />
[[Image:viewSN2010FZ_spw5_clean1280final_4.0.png|200px|thumb|right|viewer showing clean spw5 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw5_clean640*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='5:4~59', \<br />
imagename='imgSN2010FZ10s_spw5_clean640', \<br />
mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[640,640],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
</source><br />
<br />
* Start carefully by boxing the bright source and setting iterations to 10 at first<br />
* Gradually add more boxes and increase the number of iterations<br />
* Since this is not much more than a snapshot you see the six-fold sidelobe pattern<br />
of the extended emission in the center of the map. This decreases as you clean<br />
out this emission.<br />
* Stop cleaning when the residuals look like noise (and you cannot clearly see sources).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
The top figure to the right shows a zoom in on the end state of the clean, where<br />
we have marked a number of boxes and cleaned them out.<br />
<br />
Note that there are some strange sidelobe patterns in lower left, possibly <br />
from a source outside the image area. We can make a bigger image starting from<br />
our current model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw5_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='5:4~59', \<br />
imagename='imgSN2010FZ10s_spw5_clean1280', \<br />
mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
modelimage='imgSN2010FZ10s_spw5_clean640.model', \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
</source><br />
<br />
Sure enough, there is a bright source near the lower left (see middle panel at right). <br />
Box it, clean it a bit, and look again. There is a second source in the mid-left (track<br />
it down by its sidelobes). Box this one, clean it a bit, and when satisfied stop.<br />
<br />
You can use the CASA {{viewer}} to display the images that {{clean}} creates. If you need more guidance<br />
on using the viewer, see the [http://casa.nrao.edu/CasaViewerDemo/casaViewerDemo.html CASA Viewer Demo] video<br />
(note that this is for a much earlier version of the viewer, and the interface has changed since then). <br />
<br />
Bring up your restored image directly:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgSN2010FZ10s_spw5_clean1280.image')<br />
</source><br />
<br />
The restored image is shown in the bottom panel to the right. I have chosen the Grayscale1 instead of default color<br />
map as I prefer "Grayscale" to false color "Rainbow" for assessing image quality. Also, you can change the scaling of the image using the "scaling power cycles" slider under "basic settings".<br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw5_clean1280.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
In this particular case, it's 31.8 uJy; yours will likely be slightly different.<br />
<br />
=== Cleaning the lower baseband ===<br />
<br />
[[Image:viewSN2010FZ_spw0to7_clean1280final.png|200px|thumb|right|clean spw0-7 restored image center]]<br />
Now, image the entire lower baseband (spw 0-7).<br />
Follow same iterative procedure as before, and get the best<br />
residuals you can without "cleaning the noise". <br />
<br />
* Because of the bandwidth and frequency synthesis, the sidelobe pattern is different than before and it is much easier to see fainter emission.<br />
* Be careful cleaning sources that lie near or on sidelobe splotches.<br />
* Clean the central emission region way down first to reduce the sidelobe level before adding components in the sidelobe areas.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw0to7_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='0:16~59,1~6:4~59,7:4~54', \<br />
imagename='imgSN2010FZ10s_spw0to7_clean1280', \<br />
mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to7_clean1280.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
For this run, the rms is 11.3 uJy (and there is clearly some structure left in the residual). To the right is a zoom-in on the center of the restored image.<br />
<br />
==== Cleaning the lower baseband using two MFS Taylor terms ====<br />
<br />
The mfs nterms=2 option creates two "Taylor Term" images - an average intensity image (with suffix <tt>.image.tt0</tt>) <br />
and a spectral slope image (with suffix <tt>.image.tt1</tt>) which is intensity x alpha (where alpha is spectral index).<br />
For convenience there is a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "Reference Frequency" of the image (by default the center frequency of the spw selected, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). The convention for spectral index alpha is that<br />
<br />
<math><br />
S \propto \nu^\alpha<br />
</math><br />
<br />
so negative spectral indexes indicate a "steep" spectrum (falling with frequency).<br />
<br />
[[Image:viewSN2010FZ_spw0to7_mfs2clean.png|200px|thumb|right|clean spw0-7 mfs nterms=2 in progress]]<br />
Let's try using multi-frequency synthesis with nterms=2 on the lower baseband.<br />
The dirty beam will have lower sidelobes so we turn up <tt>cyclefactor</tt> for <tt>csclean</tt> a bit. Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgSN2010FZ10s_spw0to7_clean1280.mask'</tt> to use these as a starting point:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw0to7_mfs2_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms',spw='0:16~59,1~6:4~59,7:4~54', \<br />
imagename='imgSN2010FZ10s_spw0to7_mfs2_clean1280', \<br />
mode='mfs',nterms=2,niter=10000,gain=0.1,threshold='0.0mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=4.5, \<br />
weighting='briggs',robust=0.5,interactive=True,mask=[])<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to7_mfs2_clean1280.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
For this run, the rms is 10.5 uJy (somewhat better-looking than the nterms=1).<br />
The top screenshot to the right shows an intermediate but early stage of cleaning where we are looking at<br />
the central emission and cleaning it out slowly.<br />
<br />
You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0')<br />
</source><br />
<br />
and then use the Open Data panel to load the spectral index image <tt>imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha</tt><br />
which can then be blinked (optionally plotted side-by-side using the Panel Display Options panel to set 2 panels in the x direction). <br />
<br />
[[Image:viewSN2010FZ_spw0to7_mfs2loadalpha_4.0.png|200px|thumb|right|clean spw0-7 mfs nterms=2 load alpha with LEL]]<br />
[[Image:viewSN2010FZ_spw0to7_mfs2panelalpha_4.0.png|200px|thumb|right|clean spw0-7 mfs nterms=2 tt0 and alpha (filtered at 0.1mJy in tt0)]]<br />
<br />
Note there is a lot of noise in alpha in the low-intensity regions, and thus filtering the alpha image based on the values in the tt0 image is desirable. You can use the {{immath}} task to make this filtered alpha image explicitly, using a <br />
Lattice Expression Language (LEL) expression: <br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha', <br />
'imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>1.0E-4]',<br />
outfile='imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.1 mJy (or 10 x the sigma we found) as the cutoff.<br />
You can then view or manipulate the filtered alpha image as normal.<br />
<br />
We can also use LEL to filter the alpha image on the intensity on-the-fly when we load this raster in the Open Data panel<br />
by specifying a LEL string in the LEL box instead of selecting the image from the directory <br />
listing. The LEL string:<br />
<br />
<pre><br />
'imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha'['imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0'>1.0E-04]<br />
</pre><br />
<br />
will replicate what we did above. The middle figure to the right shows the Open Data panel<br />
with our LEL string in it. Just click the Raster button to load this.<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed<br />
in on the galaxy emission. Mousing over the alpha shows spectral indexes ranging from -1 to +1 in the center, with<br />
the brightest emission with alpha -0.7 in the knots in the disk.<br />
<br />
=== Cleaning using both basebands combined ===<br />
<br />
For the ultimate image, use the "clean" part of the upper baseband in addition<br />
to the lower (use spw 0-11). We will use mfs with nterms=2 (if you try nterms=1 <br />
on this wide bandwidth you will get much poorer residuals). Because of the added<br />
work and extra data involved, this will take much longer than our other runs of<br />
clean. Therefore, we will get a head start by doing a non-interactive clean using<br />
the mask left from the previous clean (spw 0-7). We will insert a clean threshold<br />
to limit runaway cleaning too far beneath the noise level. <br />
<br />
This will take a while, especially if there are other processes running on your machine (with nothing else running, expect ~30-40 minutes).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgSN2010FZ10s_spw0to11_mfs2_clean1280*')<br />
clean(vis='SN2010FZ_split10s.ms', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
imagename='imgSN2010FZ10s_spw0to11_mfs2_clean1280', \<br />
mode='mfs',nterms=2,niter=3000,gain=0.1,threshold='0.002mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=4.5, \<br />
mask=['imgSN2010FZ10s_spw0to7_mfs2_clean1280.mask'], \<br />
weighting='briggs',robust=0.5,interactive=False)<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
For this particular run, the rms was 8.9 uJy (noticeably better than the lower baseband only results).<br />
<br />
[[Image:viewSN2010FZ spw0to11_mfs2resid.png|200px|thumb|right|final residual and mask]]<br />
<br />
Let us see if there is more to clean. Bring this up in interactive mode:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='SN2010FZ_split10s.ms', \<br />
spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \<br />
imagename='imgSN2010FZ10s_spw0to11_mfs2_clean1280', \<br />
mode='mfs',nterms=2,niter=3000,gain=0.1,threshold='0.001mJy', \<br />
psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \<br />
imagermode='csclean', cyclefactor=4.5, \<br />
mask='imgSN2010FZ10s_spw0to11_mfs2_clean1280.mask', \<br />
weighting='briggs',robust=0.5,interactive=True)<br />
</source><br />
<br />
This should start cleaning from where our previous non-interactive clean left off.<br />
<b>Note for 4.2.0:</b> In this case we have specified <tt>mask='imgSN2010FZ10s_spw0to11_mfs2_clean1280.mask'</tt> explicitly due to a bug where it will not otherwise allow you to edit the mask interactively.<br />
<br />
You might find a few more sources revealed in the outer parts of the image, and also more <br />
emission around the galaxy disk in the center. Try drawing new boxes, perhaps extend the box<br />
in the center, and do ~100-1000 more iterations. At the end, what is left should be dominated<br />
by the error patterns from mis-calibration. Only self-calibration will get rid of<br />
these. Stop cleaning for now. See the figure to the right for the interactive display panel<br />
showing final residuals and mask (changing the colormap to <tt>Greyscale 1</tt>).<br />
<br />
Check the residual levels:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.residual.tt0')<br />
sigma = mystat['sigma'][0]<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
<br />
The final rms achieved here is 8.6 uJy; slightly better.<br />
<br />
== Analyzing the image ==<br />
<br />
Let's see how close we got to expected noise and dynamic range:<br />
<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0')<br />
peak = mystat['max'][0]<br />
print 'Image max flux = '+str(mystat['max'][0])<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.model.tt0')<br />
total = mystat['sum'][0]<br />
print 'Model total flux = '+str(mystat['sum'][0])<br />
#<br />
snr = peak/sigma<br />
print 'SN2010FZ peak S/N = '+str(snr)<br />
#<br />
snr = total/sigma<br />
print 'SN2010FZ total S/N = '+str(snr)<br />
</source><br />
The output gives:<br />
<pre><br />
Residual standard deviation = 8.60710739215e-06<br />
Image max flux = 0.00995589420199<br />
Model total flux = 0.0371581438531<br />
SN2010FZ peak S/N = 1156.70616717<br />
SN2010FZ total S/N = 4317.14653485<br />
</pre><br />
<br />
What do we expect? If we do {{listobs}} on this MS we see the scans:<br />
<pre><br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) <br />
11-Jul-2010/21:38:44.0 - 21:39:51.0 9 0 SN2010FZ 33696 9.16 <br />
21:40:01.0 - 21:41:20.5 10 0 SN2010FZ 37908 9.89 <br />
21:41:30.0 - 21:42:50.0 11 0 SN2010FZ 37908 10 <br />
21:43:00.0 - 21:44:20.0 12 0 SN2010FZ 37908 10 <br />
21:44:30.0 - 21:45:50.0 13 0 SN2010FZ 37908 10 <br />
21:46:00.0 - 21:47:19.5 14 0 SN2010FZ 37908 9.89 <br />
21:47:29.0 - 21:47:49.0 15 0 SN2010FZ 12636 9.67 <br />
21:49:42.0 - 21:50:49.0 17 0 SN2010FZ 33696 9.17 <br />
21:50:59.0 - 21:52:19.0 18 0 SN2010FZ 37908 10 <br />
21:52:29.0 - 21:53:48.5 19 0 SN2010FZ 37908 9.89 <br />
21:53:58.0 - 21:55:18.0 20 0 SN2010FZ 37908 10 <br />
21:55:28.0 - 21:56:48.0 21 0 SN2010FZ 37908 10 <br />
21:56:58.0 - 21:58:18.0 22 0 SN2010FZ 37908 10 <br />
21:58:28.0 - 21:58:47.5 23 0 SN2010FZ 12636 9.67 <br />
22:00:39.5 - 22:01:47.0 25 0 SN2010FZ 33696 9.18 <br />
22:01:57.0 - 22:03:17.0 26 0 SN2010FZ 37908 10 <br />
22:03:27.0 - 22:04:47.0 27 0 SN2010FZ 37908 10 <br />
22:04:57.0 - 22:06:16.5 28 0 SN2010FZ 37908 9.89 <br />
22:06:26.0 - 22:07:46.0 29 0 SN2010FZ 37908 10 <br />
22:07:56.0 - 22:09:16.0 30 0 SN2010FZ 37908 10 <br />
22:09:26.0 - 22:09:45.5 31 0 SN2010FZ 12636 9.67 <br />
22:11:38.0 - 22:12:45.5 33 0 SN2010FZ 33696 9.19 <br />
22:12:55.0 - 22:14:15.0 34 0 SN2010FZ 37908 10 <br />
22:14:25.0 - 22:15:45.0 35 0 SN2010FZ 37908 10 <br />
22:15:55.0 - 22:17:15.0 36 0 SN2010FZ 37908 10 <br />
22:17:25.0 - 22:18:44.5 37 0 SN2010FZ 37908 9.89 <br />
22:18:54.0 - 22:20:14.0 38 0 SN2010FZ 37908 10 <br />
22:20:24.0 - 22:20:43.5 39 0 SN2010FZ 12636 9.67 <br />
(nVis = Total number of time/baseline visibilities per scan) <br />
</pre><br />
(listing columns truncated) and we estimate about 37 minutes on target. We had about 25 antennas on average, and our spw selection picked out 610 channels (2 MHz each) for a total of 1220 MHz bandwidth. If we plug this<br />
into the<br />
[https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure EVLA exposure calculator], at 5 GHz, we find that we expect a rms thermal noise level of 8.7 uJy, and at 7 GHz, 7.0 uJy. So, our values are within the expected range (a bit higher than theoretical, but that's expected). <br />
<br />
[[Image:plotSN2010FZ_viewerfinal.png|200px|thumb|right|final image]]<br />
Look at this in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0')<br />
</source><br />
Zoom in on the center (see figure to the right).<br />
<br />
[[Image:viewSN2010FZ_spw0to11_mfs2tt1.png|200px|thumb|right|final tt1 image with box]]<br />
In the previous section we demonstrated how to process and display the spectral index image. You can do<br />
the same for this final image. Here, we will do some rough analysis on the spectral index to determine<br />
an intensity-weighted mean spectral index over the core region.<br />
The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image. See the figure to the right.<br />
Let's gate the Taylor-term images on intensity:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered')<br />
immath(imagename=['imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1',<br />
'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>5.0E-5]',<br />
outfile='imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered')<br />
immath(imagename=['imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>5.0E-5]',<br />
outfile='imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered')<br />
</source><br />
<br />
We can identify a box containing the central emission (see figure of tt1 in viewer) and note the corners.<br />
(We could also use the region tools from the viewer, but that is for another exercise.)<br />
Let us compute the intensity-weighted spectral index over this box by averaging<br />
these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered',<br />
box='503,533,756,762')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered',<br />
box='503,533,756,762')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha/avgtt0<br />
print 'SN2010FZ I-weighted Alpha = '+str(avgalpha)<br />
</source><br />
We get <br />
<pre><br />
SN2010FZ I-weighted Alpha = -1.38157453384<br />
</pre><br />
<br />
The emission in this source is on the steep side. At this point we do not know how reliable this is or<br />
what we expect (though our calibrators come out with correct spectral indexes if we image them the<br />
same way). But this illustrates a way to extract spectral information from our wideband mfs images.<br />
<br />
== Comparing with the Optical/Infrared ==<br />
<br />
As a final comparison, we turn to the Sloan Digital Sky Survey (SDSS) and a cutout image of our galaxy:<br />
[[Image:NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg|400px|thumb|center|]]<br />
from their [http://cosmo.nyu.edu/hogg/rc3/NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg RC3]<br />
album (courtesy D.Hogg, M.Blanton, SDSS collaboration - see [[#Credits]]). This looks like a nice nearby<br />
face-on spiral galaxy. How does our 6cm continuum emission line up with the optical?<br />
<br />
Here is the EVLA 6cm image side by side with a i-band image from the Sloan Digital Sky Survey (SDSS) registered to our image:<br />
<br />
[[Image:plotSN2010FZ viewerfinalandSDSS.png|600px|thumb|center|final and sdss image]]<br />
<br />
You can also find this image, named <tt>NGC_2967_UGC_5180_IRAS_09394+0033-i.fits</tt>, on the web at <tt>http://casa.nrao.edu/Data/EVLA/SN2010FZ/NGC_2967_UGC_5180_IRAS_09394+0033-i.fits</tt> (at the CASA workshop, it's in <tt>/data/casa/evla/</tt> or a similar location that will be given to you in the instructions). Load it into your viewer, and blink against our 6cm image.<br />
<br />
We can also plot one as a raster and the other overlaid as contours. You can load the SDSS image<br />
from the viewer Load Data panel and fiddle with contours. Once you know contour levels, you can<br />
also use the imview task to load a raster and contour image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
imview(raster={ 'file' : 'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'},<br />
contour = { 'file' : 'NGC_2967_UGC_5180_IRAS_09394+0033-i.fits',<br />
'levels' : [0.2, 0.5, 1, 1.5, 3],<br />
'base' : 0.0,<br />
'unit' : 1.0 } )<br />
</source><br />
<br />
The figure below shows the SDSS contours overlaid on our 6cm image (after fiddling with the <br />
colormap shift/slope for the EVLA raster image). <br />
<br />
[[Image:viewSN2010FZ_spw0to11_mfs2tt0plusSDSS.png|400px|thumb|center|6cm EVLA raster plus SDSS i-band contours]]<br />
<br />
Likewise, we can plot the SDSS image as a raster and overlay EVLA 6cm contours:<br />
<br />
<source lang="python"><br />
# In CASA<br />
imview(raster={ 'file' : 'NGC_2967_UGC_5180_IRAS_09394+0033-i.fits',<br />
'scaling' : -2.0,<br />
'range' : [0,10] },<br />
contour = { 'file' : 'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0',<br />
'levels' : [0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56],<br />
'base' : 0.0,<br />
'unit' : 0.001 },<br />
zoom = { 'blc' : [397,300],<br />
'trc' : [1567,1231] } )<br />
</source><br />
<br />
This is shown in the figure below. Is the compact 6cm emission in upper left associated with a<br />
spiral arm?<br />
<br />
[[Image:viewSN2010FZ_spw0to11_SDSSiplusEVLA6cm.png|400px|thumb|center|SDSS i-band raster plus EVLA 6cm contours]]<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Use multi-scale clean by adding non-zero scales to the <tt>multiscale</tt> parameter.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>testautoflag</tt> task (in 3.3.0 and later) to automatically flag RFI from the upper sideband. There is more information on running <tt>testautoflag</tt> in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4_(Caltech) this tutorial].<br />
<br />
== Credits ==<br />
<br />
The EVLA data was taken by A. Soderberg et al. as part of project AS1015. See <br />
[https://science.nrao.edu/enews/3.8/index.shtml#evlanoise NRAO eNews 3.8] (1-Sep-2010) for more on this result.<br />
<br />
<blockquote><i><br />
The Expanded Very Large Array (EVLA) is a partnership of the United States, Canada, and Mexico. The EVLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
SDSS image courtesy David Hogg & Michael Blanton, private communication. Data comes from<br />
SDSS DR7, see [http://adsabs.harvard.edu/abs/2009ApJS..182..543A Abazajian et. al 2009].<br />
<br />
<blockquote><i><br />
Funding for the SDSS and SDSS-II has been provided by the Alfred P. Sloan Foundation, the Participating Institutions, the National Science Foundation, the U.S. Department of Energy, the National Aeronautics and Space Administration, the Japanese Monbukagakusho, the Max Planck Society, and the Higher Education Funding Council for England. The SDSS Web Site is [http://www.sdss.org/].<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The SDSS is managed by the Astrophysical Research Consortium for the Participating Institutions. The Participating Institutions are the American Museum of Natural History, Astrophysical Institute Potsdam, University of Basel, University of Cambridge, Case Western Reserve University, University of Chicago, Drexel University, Fermilab, the Institute for Advanced Study, the Japan Participation Group, Johns Hopkins University, the Joint Institute for Nuclear Astrophysics, the Kavli Institute for Particle Astrophysics and Cosmology, the Korean Scientist Group, the Chinese Academy of Sciences (LAMOST), Los Alamos National Laboratory, the Max-Planck-Institute for Astronomy (MPIA), the Max-Planck-Institute for Astrophysics (MPA), New Mexico State University, Ohio State University, University of Pittsburgh, University of Portsmouth, Princeton University, the United States Naval Observatory, and the University of Washington.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15602EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T17:14:48Z<p>Knyland: /* Bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15601EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T17:14:15Z<p>Knyland: /* Bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. As before, we first generate a phase-only, gain calibration table that will be used to help smooth-out the phases before running {{bandpass}} itself:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15600EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T17:10:07Z<p>Knyland: /* Setting the flux density scale */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', model='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15599EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T02:14:30Z<p>Knyland: /* Evaluating results & further manual flagging */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='RR,LL', coloraxis='antenna1', symbolshape = 'circle')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15598EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T02:07:25Z<p>Knyland: /* Evaluating results & further manual flagging */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='RR,LL', coloraxis='spw', symbolshape = 'circle')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15597EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-10T01:26:50Z<p>Knyland: /* Automatic flagging */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2', symbolshape = 'circle',<br />
iteraxis='scan', correlation='RR,LL', coloraxis = 'baseline')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15596EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T23:33:06Z<p>Knyland: /* Using the phase calibration source for preliminary bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to calculate phase-only solutions that will be used as input during our initial bandpass calibration. Remember - the calibration tables we are creating now are so that we can use automatic RFI flagging algorithms. Our final calibration tables will be generated later, after automated flagging. Here are the inputs for our initial pre-bandpass phase calibration:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the antenna position corrections as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped-out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position corrections and the bandpass calibration table to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15595EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T20:18:14Z<p>Knyland: /* Using phase calibration source for preliminary bandpass calibration */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using the phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15594EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T20:08:11Z<p>Knyland: /* Hanning-smoothing data */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15593EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T20:07:48Z<p>Knyland: /* Hanning-smoothing data */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle', <br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw', symbolshape = 'circle',<br />
correlation='RR,LL', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take some time to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}}, a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot."<br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15592EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:47:36Z<p>Knyland: /* Flagging non-operational antennas */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags using the {{flagmanager}} task.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15591EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:45:00Z<p>Knyland: /* Gain curve and opacity correction */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see this [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15590EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:39:17Z<p>Knyland: /* Gain curve and opacity correction */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192|this tutorial.]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15589EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:38:20Z<p>Knyland: /* Gain curve and opacity correction */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial. These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz). At higher frequencies, these corrections may be important and the appropriate calibration tables can be computed using the task {{gencal}}. For an example of a tutorial which corrects for atmospheric opacity and the elevation-dependent gain see [[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192]]<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15588EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:28:45Z<p>Knyland: /* Antenna position correction */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. <br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15587EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:25:43Z<p>Knyland: /* Preliminary data evaluation */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection. One can flip through these plots using the green arrows located at the bottom of the plotting GUI: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the {{plotms}} GUI (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass sign), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), different averaging techniques (under "Data"), or different selections for the coloraxis (the "colorize" option under "Display").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15586EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:17:36Z<p>Knyland: /* Preliminary data evaluation */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful as a guide to help determine which antenna to use as the reference antenna later during calibration.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='RR,LL', symbolshape='circle')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15585EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:14:41Z<p>Knyland: /* Preliminary data evaluation */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation. Note that you can select sources based on their intents in certain CASA tasks. The various scan intents in this dataset are:<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15584EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:11:03Z<p>Knyland: /* Start and confirm your version of CASA */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.2.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 28322):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation, and may be selected on using CASA tasks. In particular,<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15583EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:08:05Z<p>Knyland: /* Obtaining the data */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~15GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 15 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size (to around 45 GB).<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.1.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 24028):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation, and may be selected on using CASA tasks. In particular,<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15582EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T19:06:58Z<p>Knyland: /* Obtaining the data */</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~14GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and application of the online flags.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 14 GB; the addition of columns for model and corrected data (known as "scratch columns") during calibration will ultimately inflate the MS by a factor of a few in size.<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.1.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 24028):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation, and may be selected on using CASA tasks. In particular,<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15581EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T03:30:53Z<p>Knyland: </p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|the same guide for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~14GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and online flag application.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 14 GB; the addition of columns for model and corrected data (known as "scratch columns") inflates it to 43 GB, which is the size of the MS we will be using here.<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.1.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 24028):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation, and may be selected on using CASA tasks. In particular,<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15580EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T03:29:41Z<p>Knyland: </p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1|for CASA v4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|for CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|for CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~14GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and online flag application.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 14 GB; the addition of columns for model and corrected data (known as "scratch columns") inflates it to 43 GB, which is the size of the MS we will be using here.<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.1.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 24028):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation, and may be selected on using CASA tasks. In particular,<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_-_CASA4.2&diff=15579EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.22014-02-07T03:28:30Z<p>Knyland: Created page with "* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1, [[EVLA_Wide-Band_..."</p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1]], [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|the same guide for CASA v4.0]], or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|for CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~14GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and online flag application.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 14 GB; the addition of columns for model and corrected data (known as "scratch columns") inflates it to 43 GB, which is the size of the MS we will be using here.<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.1.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 24028):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation, and may be selected on using CASA tasks. In particular,<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4&diff=15578EVLA Wide-Band Wide-Field Imaging: G55.7 3.42014-02-07T03:26:24Z<p>Knyland: </p>
<hr />
<div>* '''This CASA Guide is designed for CASA v4.1. If you are using an older version of CASA please see [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA4.0|the same guide for CASA v4.0]] or [[EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4-CASA3.4|for CASA v3.4]].'''<br />
<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.1]]<br />
[[EVLA Wide-Band Wide-Field Imaging: G55.7 - CASA4.2]]<br />
<br />
<br />
== Overview ==<br />
<br />
This CASA Guide describes the imaging of the supernova remnant [http://simbad.u-strasbg.fr/simbad/sim-id?Ident=SNR+G055.7%2B03.4&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id G55.7+3.4.]. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency. <br />
<br />
== Obtaining the data ==<br />
<br />
A copy of the data can be downloaded here: [http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G55/G55.7+3.4_10s.ms.tar.gz]<br />
<br />
<font color=red>Note that this dataset is rather large: ~14GB </font><br />
<br />
As a start, unzip and untar the data:<br />
<br />
<source lang="bash"><br />
tar -xzvf G55.7+3.4_10s.ms.tar.gz<br />
</source><br />
<br />
This will take a minute, but once it's complete, you will have a directory called <tt>G55.7+3.4_10s.ms</tt> which is the data. Online flags have been applied (which delete known bad data), some uninteresting scans removed, and the data time-averaged to 10 seconds. (The data were taken in D-configuration, where maximum baselines are 1 km, so one can safely average to 3s or even 10s to reduce data set size.) This is equivalent to what you would download from the archive if you requested time-averaging, scans 16~313, and online flag application.<br />
<br />
You can also find the dataset [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query| in the NRAO archive]. ''Note that it is 170 GB in raw form.'' <br />
<br />
Averaging to 10 seconds and the removal of some scans which are not used in this tutorial reduces the size of the data set to around 14 GB; the addition of columns for model and corrected data (known as "scratch columns") inflates it to 43 GB, which is the size of the MS we will be using here.<br />
<br />
== Start and confirm your version of CASA ==<br />
<br />
Start CASA by typing <tt>casapy</tt> on the command line. If you have not used CASA before, some helpful tips are available on the [[Getting Started in CASA]] page.<br />
<br />
This guide has been written for CASA release 4.1.0. Please confirm your version before proceeding.<br />
<source lang="python"><br />
# In CASA<br />
version = casalog.version()<br />
print "You are using " + version<br />
if (int(version.split()[4][1:-1]) < 24028):<br />
print "\033[91m YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."<br />
print "\033[91m PLEASE UPDATE IT BEFORE PROCEEDING."<br />
else:<br />
print "Your version of CASA is appropriate for this guide."<br />
</source><br />
<br />
== Preliminary data evaluation == <br />
<br />
As a first step, use {{listobs}} to have a look at the MS:<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
Note that throughout this tutorial, we will run tasks using the <i>task</i>(<i>parameter=value</i>) syntax. When called in this manner, all parameters not explicitly set will use their default values. <br />
<br />
The logger output will look like this:<br />
<br />
<pre><br />
##########################################<br />
##### Begin Task: listobs #####<br />
listobs(vis="G55.7+3.4_10s.ms",selectdata=True,spw="",field="",<br />
antenna="",uvrange="",timerange="",correlation="",scan="",<br />
intent="",feed="",array="",observation="",verbose=True,<br />
listfile="")<br />
================================================================================<br />
MeasurementSet Name: /scr2/casa/evla_G55/G55.7+3.4_10s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Sanjay Sanjay Bhatnagar Project: T.B.D. <br />
Observation: EVLA<br />
Data records: 7343848 Total integration time = 26691.5 seconds<br />
Observed from 23-Aug-2010/01:00:25.0 to 23-Aug-2010/08:25:16.5 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows Int(s) SpwIds ScanIntent<br />
23-Aug-2010/01:00:25.0 - 01:01:00.5 16 1 J1925+2106 8008 7.79 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:01:10.0 - 01:02:30.0 17 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:02:40.0 - 01:04:00.0 18 1 J1925+2106 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:04:10.0 - 01:05:29.5 19 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:05:39.0 - 01:06:59.0 20 1 J1925+2106 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_PHASE.UNSPECIFIED<br />
01:07:12.0 - 01:08:29.0 21 2 G55.7+3.4 25064 9.33 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:08:39.0 - 01:09:59.0 22 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:10:09.0 - 01:11:29.0 23 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:11:39.0 - 01:12:58.5 24 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:13:08.0 - 01:14:28.0 25 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:14:38.0 - 01:15:58.0 26 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:16:08.0 - 01:17:28.0 27 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:17:38.0 - 01:18:57.5 28 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:19:07.0 - 01:20:27.0 29 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
01:20:37.0 - 01:21:57.0 30 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
<snip><br />
08:04:31.0 - 08:05:50.5 300 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:06:00.0 - 08:07:20.0 301 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:07:30.0 - 08:08:50.0 302 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:09:00.0 - 08:10:20.0 303 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:10:30.0 - 08:11:49.5 304 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:11:59.0 - 08:13:19.0 305 2 G55.7+3.4 25272 10 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:13:29.0 - 08:14:48.5 306 2 G55.7+3.4 25272 9.89 [0, 1, 2, 3, 4, 5, 6, 7] OBSERVE_TARGET.UNSPECIFIED<br />
08:17:50.5 - 08:17:50.5 308 3 0542+498=3C147 80 4 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:17:59.0 - 08:19:18.5 309 3 0542+498=3C147 17152 9.36 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:19:28.0 - 08:20:48.0 310 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:20:58.0 - 08:22:18.0 311 3 0542+498=3C147 18216 10 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:22:28.0 - 08:23:47.5 312 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
08:23:57.0 - 08:25:16.5 313 3 0542+498=3C147 18216 9.89 [0, 1, 2, 3, 4, 5, 6, 7] CALIBRATE_AMPLI.UNSPECIFIED,UNSPECIFIED.UNSPECIFIED,CALIBRATE_BANDPASS.UNSPECIFIED<br />
(nRows = Total number of rows per scan) <br />
Fields: 3<br />
ID Code Name RA Decl Epoch SrcId nRows <br />
1 D J1925+2106 19:25:59.60537 +21.06.26.1622 J2000 1 1004816<br />
2 NONE G55.7+3.4 19:21:40.00000 +21.45.00.0000 J2000 2 6248936<br />
3 N 0542+498=3C147 05:42:36.13792 +49.51.07.2336 J2000 3 90096 <br />
(nVis = Total number of time/baseline visibilities per field) <br />
Spectral Windows: (8 unique spectral windows and 1 unique polarization setups)<br />
SpwID #Chans Frame Ch1(MHz) ChanWid(kHz) TotBW(kHz) Corrs <br />
0 64 TOPO 1000 2000 128000 RR RL LR LL <br />
1 64 TOPO 1128 2000 128000 RR RL LR LL <br />
2 64 TOPO 1256 2000 128000 RR RL LR LL <br />
3 64 TOPO 1384 2000 128000 RR RL LR LL <br />
4 64 TOPO 1520 2000 128000 RR RL LR LL <br />
5 64 TOPO 1648 2000 128000 RR RL LR LL <br />
6 64 TOPO 1776 2000 128000 RR RL LR LL <br />
7 64 TOPO 1904 2000 128000 RR RL LR LL <br />
Sources: 24<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
1 J1925+2106 0 - - <br />
1 J1925+2106 1 - - <br />
1 J1925+2106 2 - - <br />
1 J1925+2106 3 - - <br />
1 J1925+2106 4 - - <br />
1 J1925+2106 5 - - <br />
1 J1925+2106 6 - - <br />
1 J1925+2106 7 - - <br />
2 G55.7+3.4 0 - - <br />
2 G55.7+3.4 1 - - <br />
2 G55.7+3.4 2 - - <br />
2 G55.7+3.4 3 - - <br />
2 G55.7+3.4 4 - - <br />
2 G55.7+3.4 5 - - <br />
2 G55.7+3.4 6 - - <br />
2 G55.7+3.4 7 - - <br />
3 0542+498=3C147 0 - - <br />
3 0542+498=3C147 1 - - <br />
3 0542+498=3C147 2 - - <br />
3 0542+498=3C147 3 - - <br />
3 0542+498=3C147 4 - - <br />
3 0542+498=3C147 5 - - <br />
3 0542+498=3C147 6 - - <br />
3 0542+498=3C147 7 - - <br />
Antennas: 27:<br />
ID Name Station Diam. Long. Lat. <br />
0 ea01 W09 25.0 m -107.37.25.2 +33.53.51.0 <br />
1 ea02 E02 25.0 m -107.37.04.4 +33.54.01.1 <br />
2 ea03 E09 25.0 m -107.36.45.1 +33.53.53.6 <br />
3 ea04 W01 25.0 m -107.37.05.9 +33.54.00.5 <br />
4 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 <br />
5 ea06 N06 25.0 m -107.37.06.9 +33.54.10.3 <br />
6 ea07 E05 25.0 m -107.36.58.4 +33.53.58.8 <br />
7 ea08 N01 25.0 m -107.37.06.0 +33.54.01.8 <br />
8 ea09 E06 25.0 m -107.36.55.6 +33.53.57.7 <br />
9 ea10 N03 25.0 m -107.37.06.3 +33.54.04.8 <br />
10 ea11 E04 25.0 m -107.37.00.8 +33.53.59.7 <br />
11 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 <br />
12 ea13 N07 25.0 m -107.37.07.2 +33.54.12.9 <br />
13 ea15 W06 25.0 m -107.37.15.6 +33.53.56.4 <br />
14 ea16 W02 25.0 m -107.37.07.5 +33.54.00.9 <br />
15 ea17 W07 25.0 m -107.37.18.4 +33.53.54.8 <br />
16 ea18 N09 25.0 m -107.37.07.8 +33.54.19.0 <br />
17 ea19 W04 25.0 m -107.37.10.8 +33.53.59.1 <br />
18 ea20 N05 25.0 m -107.37.06.7 +33.54.08.0 <br />
19 ea21 E01 25.0 m -107.37.05.7 +33.53.59.2 <br />
20 ea22 N04 25.0 m -107.37.06.5 +33.54.06.1 <br />
21 ea23 E07 25.0 m -107.36.52.4 +33.53.56.5 <br />
22 ea24 W05 25.0 m -107.37.13.0 +33.53.57.8 <br />
23 ea25 N02 25.0 m -107.37.06.2 +33.54.03.5 <br />
24 ea26 W03 25.0 m -107.37.08.9 +33.54.00.1 <br />
25 ea27 E03 25.0 m -107.37.02.8 +33.54.00.5 <br />
26 ea28 N08 25.0 m -107.37.07.5 +33.54.15.8 <br />
<br />
##### End Task: listobs #####<br />
##########################################<br />
</pre><br />
<br />
We can see that there are three sources in this observation:<br />
<br />
* J1925+2106, field ID 1: the phase calibrator;<br />
* G55.7+3.4, field ID 2: the supernova remnant;<br />
* 0542+498=3C147, field ID 3: the flux and bandpass calibrator.<br />
<br />
We can also see that these sources have associated "scan intents", which indicate their function in the observation, and may be selected on using CASA tasks. In particular,<br />
<br />
* CALIBRATE_PHASE indicates that this is a scan to be used for gain calibration;<br />
* OBSERVE_TARGET indicates that this is the science target;<br />
* CALIBRATE_AMPLI indicates that this is to be used for flux calibration; and <br />
* CALIBRATE_BANDPASS indicates that these scans are to be used for bandpass calibration.<br />
<br />
Note that 3C147 is to be used for both flux and bandpass calibration.<br />
<br />
We can see the antenna configuration for this observation using {{plotants}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotants('G55.7+3.4_10s.ms')<br />
</source><br />
<br />
[[Image:plotAnts.png|200px|thumb|right|plotants image]]<br />
<br />
This shows that antennas ea01, ea18, and ea03 were on the extreme ends of the west, north, and east arms, respectively. The antenna position diagram is particularly useful in determining if a co-located set of antennas is affected, which can help with flagging.<br />
<br />
We may also inspect the raw data using {{plotms}}. To start with, let's look at a subset of scans on the supernova remnant:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
The <tt>coloraxis</tt> parameter indicates that a different color will be assigned to each spectral window, and the <tt>iteraxis</tt> parameter tells plotms to display a new plot for each scan. We have chosen only one antenna (ea24) and just the right and left circular polarizations (without the cross-hand terms) to reduce the amount of data in the selection, One can flip through these plots using the green arrows located at the bottom of the plotting gui: the double-left arrow will display the very first plot in the set, the single left arrow will go back one plot, and the right arrows have similar behavior for moving forward in the set. <br />
<br />
[[Image:PlotMS1.png|200px|thumb|right|plotms image]]<br />
<br />
Flipping through the scans, it's clear that there is significant time- and frequency-variable RFI present in this observation. Since this is L-band data taken in the most compact EVLA configuration ("D"), this comes as no surprise. However, it also poses one of the greatest challenges for obtaining a good image.<br />
<br />
In particular, we can see that two spectral windows (SPWs) are quite badly affected. To determine which these are, click in the "Mark Regions" tool at the bottom of the gui (the open box with a green "plus" sign), and use the mouse to select a few of the highest-amplitude points in each of these SPWs. Click on the "Locate" button (magnifying glass), and information associated with the selected points will be displayed in the logger window:<br />
<br />
<pre><br />
Frequency in [1.22177 1.27139] or [1.5762 1.65063], Amp in [23.1713 24.3056] or [59.6296 63.6806]:<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:20:57.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.5243 (38134/11/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.6116 (40310/12/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.4432 (41462/12/1526)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:57.0 BL=ea03@E09 & ea24@W05[2&22] Spw=1 Chan=59 Freq=1.246 Corr=RR X=1.246 Y=23.7536 (56950/17/374)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:07.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.9097 (131282/39/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:17.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=61.1769 (134610/40/1490)<br />
Scan=30 Field=G55.7+3.4[2] Time=2010/08/23/01:21:27.0 BL=ea12@E08 & ea24@W05[11&22] Spw=4 Chan=41 Freq=1.602 Corr=RR X=1.602 Y=60.1834 (137938/41/1490)<br />
Found 7 points (7 unflagged) among 239616 in 0.02s.<br />
</pre><br />
<br />
We can see that SPWs 1 and 4 are among the worst affected by RFI. (As an aside, note that the syntax for reporting a selected point's baseline is {antenna 1 name}@{pad 1 name} &{antenna 2 name}@{pad 2 name}[{antenna 1 index}&{antenna 2 index}].) At this point, feel free to play around a bit more with {{plotms}}; you might try experimenting with different axes for iteration (under the "Iter" left-hand tab), different data selection parameters (under "Data"), different axes ("Axes"), or different averaging techniques (under "Data").<br />
<br />
== A priori calibration and flagging ==<br />
<br />
Before we proceed with further processing, we should check the observation log to see if there were any issues noted during the run that need to be addressed. The observing log file is linked to the [https://archive.nrao.edu/archive/ArchiveQuery?PASSWD=&QUERYTYPE=ARCHIVE&PROTOCOL=HTML&SORT_PARM=Starttime&SORT_ORDER=Asc&MAX_ROWS=NO+LIMIT&SORT_PARM2=Starttime&SORT_ORDER2=Asc&QUERY_ID=9999&QUERY_MODE=Prepare+Download&LOCKMODE=PROJECT&SITE_CODE=AOC&DBHOST=CHEWBACCA&WRITELOG=0&PROJECT_CODE=&SEGMENT=&OBSERVER=&ARCHIVE_VOLUME=AB1345_sb1800808_1.55431.004049953706&TIMERANGE1=&TIMERANGE2=&SOURCE_ID=&SRC_SEARCH_TYPE=SIMBAD+or+NED+Resolver&CALIB_TYPE=ALL+Srcs&CENTER_RA=&LONG_RANGE=&FRAME=Equatorial&CENTER_DEC=&LAT_RANGE=&EQUINOX=J2000&SRAD=10.0%27&MIN_EXPOSURE=&OBS_BANDS=ALL&TELESCOPE=EVLA&OBS_MODE=ALL&CORR_MODE=ALL&TELESCOPE_CONFIG=ALL&OBS_POLAR=ALL&SUBARRAY=ALL&OBSFREQ1=&DATATYPE=ALL&OBSBW1=&ARCHFORMAT=ALL&SUBMIT=Submit+Query archive web page] for this observation (at far right; under "logs etc."). Looking at the log, we can see that antenna ea07 may need a position correction, and antennas ea06, ea17, ea20, and ea26 did not have L-band receivers installed at the time and should be flagged.<br />
<br />
=== Antenna position correction ===<br />
<br />
Correcting a known position error for an antenna is done with the task {{gencal}}. This is important, because the observed visibilities are a function of <math>u</math> and <math>v</math>. If an antenna's position is incorrect, then <math>u</math> and <math>v</math> will be calculated incorrectly, and there will be errors in any image derived from the data. Of course, the a priori position corrections may not completely account for all errors. The bandpass calibration, below, will take care of remaining delay corrections.<br />
<br />
The {{gencal}} task will query the VLA Baseline Corrections database to determine what baseline corrections to apply to the dataset. If you wish to double-check this by hand, refer to the [http://www.vla.nrao.edu/astro/archive/baselines/ EVLA/VLA Baseline Corrections] page.<br />
<br />
<source lang="python"><br />
# In CASA<br />
gencal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.pos',<br />
caltype='antpos')<br />
</source><br />
<br />
As reported by the CASA logger, {{gencal}} found a position correction for antenna ea07 of (x, y, z) = (0.0087, 0.0137, 0.000) and recorded this in our specified calibration table.<br />
<br />
=== Gain curve and opacity correction ===<br />
<br />
A decision has been made here to ignore both the corrections for atmospheric opacity and for the elevation-dependent telescope gain throughout this tutorial (opacity=[], gaincurve=False in tasks such as gaincal, bandpass, and applycal). These effects are very small (less than or about 1%) across the frequency range of this observation (1-2 GHz).<br />
<br />
=== Flagging non-operational antennas ===<br />
<br />
In addition to updating the position for antenna ea07, we have to flag antennas ea06, ea17, ea20, and ea26, since these did not have working L-band receivers at the time of observation. We do this with the task {{flagdata}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='manual',<br />
antenna='ea06,ea17,ea20,ea26')<br />
</source><br />
<br />
Note that the first thing {{flagdata}} does is create a backup flag file, in this case named "flagdata_1". This flag file contains a copy of the flags present in the MS prior to the requested flagging operation, and can be found inside the <tt><MS_name>.flagversions</tt> directory, along with any other backed up flag files. Since these flag files take up a fair amount of space (in this particular case, 230 MB), we won't me making them every time we run flagdata -- the automatic flag backup can be turned off by setting flagbackup=False. However, it's good to keep a record of the names of the backup files and the associated processing step, in case you wish to restore a previous version of the flags.<br />
<br />
=== Flagging shadowed antennas and zero-amplitude data ===<br />
<br />
Since this is the most compact EVLA configuration, there may be instances where one antenna blocks, or "shadows" another. Therefore, we will run {{flagdata}} to remove these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='shadow',<br />
flagbackup=False)<br />
</source><br />
<br />
In this particular observation, there does not appear to be any data affected by shadowing, as can be seen in the logger report.<br />
<br />
In addition, there may be times during which the correlator writes out pure zero-valued data. In order to remove this bad data, we run {{flagdata}} to remove any pure zeroes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='clip',<br />
clipzeros=True, flagbackup=False) <br />
</source><br />
<br />
Inspecting the logger output which is generated by {{flagdata}} shows that there is a very small quantity of zero-valued data (0.02%) present in this MS.<br />
<br />
''Note that the archive will automatically flag shadowed antennas as well as zero-valued data, if you request that online flags are applied.''<br />
<br />
== Automatic RFI excision ==<br />
<br />
Now, we move on to one of the most difficult parts of L-band, D-configuration data processing: excising the RFI. For the original reduction of this MS, flagging was done by hand and took several weeks. The resulting data are offered as an option for the imaging stage of this tutorial (because careful by-hand flagging does yield a better image); however, it's not always practical to undertake this endeavor, and often the "automatic" flagging provides a reasonable (and much less time-consuming) solution. Therefore, we will demonstrate the use of the automatic RFI excision tools currently available in CASA.<br />
<br />
=== Hanning-smoothing data ===<br />
<br />
Prior to flagging any data which is affect by strong RFI, one should Hanning-smooth the data to remove Gibbs ringing. This is done with the task {{hanningsmooth}}, which can either write a new, Hanning-smoothed MS or directly operate on the requested column of the input MS. To conserve space, we will request the latter. Note that if you wish to make your own "before" and "after" plots, you should make the first <i>prior</i> to running {{hanningsmooth}}, since you <i>will</i> be overwriting the non-Hanning-smoothed data in the process -- and this is not reversible. <br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~2',<br />
xaxis='freq', yaxis='amp', coloraxis='spw', <br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.beforeHanning.png')<br />
<br />
hanningsmooth(vis='G55.7+3.4_10s.ms', datacolumn='data')<br />
<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30', antenna='ea24', spw='0~3', <br />
xaxis='freq', yaxis='amp', coloraxis='spw',<br />
correlation='rr,ll', plotrange=[1.0,1.27,-0.3,2.5], <br />
plotfile='amp_v_freq.afterHanning.png')<br />
</source><br />
<br />
[[Image:PlotMS2.png|200px|thumb|left|before Hanning smoothing]]<br />
[[Image:PlotMS3.png|200px|thumb|right|after Hanning smoothing]]<br />
<br />
Task {{hanningsmooth}} will take a few minutes to run. Note that the 2nd {{plotms}} command above contains a trivial change in the spw selection (trivial because the 4th spw is outside of the specified plotrange). This forces {{plotms}} to reload the plot since by default, {{plotms}} will not redraw a plot if the input parameters are unchanged. In this case, since the data column was changed between calls to {{plotms}} a redraw is necessary. When using the GUI, you can simply check "force reload" in the bottom left corner of the side bar before clicking "Plot". <br />
<br />
We can compare the Hanning-smoothed data with the raw data by plotting a subset of data to show the result of Hanning-smoothing (see plots to the left and right). As you can see, the smoothing has spread the single-channel RFI into three channels, but has also removed the effects of some of the worst RFI from a number of channels. Overall, this will improve our ability to flag RFI from the data and retain as much good data as possible.<br />
<br />
=== Using phase calibration source for preliminary bandpass calibration ===<br />
<br />
In order to get the best possible result from the automatic RFI excision, we will first apply bandpass calibration to the MS. Since the RFI is time-variable, using the phase calibration source to make an average bandpass over the entire observation will mitigate the amount of RFI present in the calculated bandpass. (For the final calibration, we will use the designated bandpass source 3C147; however, since this object was only observed in the last set of scans, it doesn't sample the time variability and would not provide a good average bandpass.)<br />
<br />
Since there are likely to be gain variations over the course of the observation, we will run {{gaincal}} to solve for an initial set of antenna-based phases over a narrow range of channels. These will be used to create the bandpass solutions. While amplitude variations will have little effect on the bandpass solutions, it is important to solve for these phase variations with sufficient time resolution to prevent decorrelation when vector averaging the data in computing the bandpass solutions.<br />
<br />
In order to choose a narrow range of channels for each spectral window which are relatively RFI-free over the course of the observation, we can look at the data with {{plotms}}. Note that it's important to only solve for phase using a narrow channel range, since an antenna-specific delay will cause the phase to vary with respect to frequency over the spectral window, perhaps by a substantial amount.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='channel', yaxis='amp', iteraxis='spw',<br />
yselfscale=True, correlation='rr,ll')<br />
</source><br />
<br />
* yselfscale=True: sets the y-scaling to be for the currently displayed spectral window, since some spectral windows have much worse RFI and will skew the scale for others.<br />
<br />
Looking at these plots, we can choose appropriate channel ranges for each SPW:<br />
<br />
<pre><br />
SPW 0: 10-13<br />
SPW 1: 30-33<br />
SPW 2: 32-35<br />
SPW 3: 30-33<br />
SPW 4: 35-38<br />
SPW 5: 30-33<br />
SPW 6: 30-33<br />
SPW 7: 46-49<br />
</pre><br />
<br />
Using these channel ranges, we run {{gaincal}} to perform phase-only solutions over the course of the observation:<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initPh',<br />
intent='CALIBRATE_PHASE*', solint='int',<br />
spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49',<br />
refant='ea24', minblperant=3,<br />
minsnr=3.0, calmode='p', gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
* caltable='G55.7+3.4_10s.initPh': this is the output calibration table that will be written.<br />
* intent='CALIBRATE_PHASE*': this is the way we have chosen to select data. Alternatively, we could have used "field='J1925+2106'", since this is the only source with the CALIBRATE_PHASE* scan intent. Note the use of the wildcard character "*" at the end of the string; this accounts for the fact that all the intents end with ".UNSPECIFIED". We could just as well have used "*PHASE*".<br />
* solint='int': we request a solution for each 10-second integration.<br />
* spw='0:10~13,1;3;5~6:30~33,2:32~35,4:35~38,7:46~49': note the syntax of this selection: a ":" is used to separate the SPW from channel selection, ";" is used to separate <i>within</i> this selection, and "~" is used to indicate an inclusive range. <br />
* refant='ea24': we have chosen ea24 as the reference antenna after inspecting the antenna position diagram (see above). It is relatively close to, but not directly in, the center of the array, which could be important in D-configuration, since you don't want the reference antenna to have a high probability of being shadowed by nearby antennas.<br />
* minblperant=3: the minimum number of baselines which must be present to attempt a phase solution.<br />
* minsnr=3.0: the minimum signal-to-noise a solution must have to be considered acceptable. Note that solutions which fail this test will cause these data to be flagged downstream of this calibration step.<br />
* calmode='p': perform phase-only solutions.<br />
* gaintable='G55.7+3.4_10s.pos': use the antenna position correction for ea07 that we created earlier.<br />
<br />
Note that a number of solutions do not pass the requirements of the minimum 3 baselines (generating the terminal message "Insufficient unflagged antennas to proceed with this solve.") or minimum signal-to-noise ratio (outputting "n of x solutions rejected due to SNR < 3 ..."). A particularly large number of solutions are rejected in SPW 4, where the RFI is most severe.<br />
<br />
[[Image:plotcal1.png|200px|thumb|right|Phases for antenna ea09]]<br />
[[Image:plotcal2.png|200px|thumb|right|Phases in SPW 4]]<br />
<br />
We can inspect the resulting calibration table with {{plotcal}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='antenna', spw='0', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
This iterates over antenna for a single spectral window; we can see that the phase does not change much over the course of the observation for SPW 0. We may also iterate over spectral window for a subset of antennas:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initPh', xaxis='time', yaxis='phase',<br />
iteration='spw', antenna='ea01,ea05,ea24', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Clearly, the phases are affected by RFI in some places, especially in SPW 4.<br />
<br />
Using this phase information, we create time-averaged bandpass solutions for the phase calibration source:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.initBP',<br />
intent='CALIBRATE_PHASE*', solint='inf',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
* gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initPh']: we will pre-apply both the corrected antenna position as well as the initial phase solutions.<br />
* interp=[<nowiki>''</nowiki>, 'nearest']: by default, {{gaincal}} will use linear interpolation for pre-applied calibration. However, we want the <i>nearest</i> phase solution to be used for a given time.<br />
<br />
Again, we can see that a number of solutions have been rejected by our choices of <tt>minblperant</tt> and <tt>minsnr</tt>.<br />
<br />
[[Image:plotcal3.png|200px|thumb|right|Bandpasses for antennas ea10 - ea19]]<br />
<br />
We may plot the bandpasses with plotcal; first looking at the amplitudes:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
* subplot=331: displays 3x3 plots per screen<br />
<br />
Also, we can look at the phase solutions:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.initBP', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
We can see that SPW 4 is virtually wiped out by RFI; furthermore, there are channels in SPW 1 that are consistently badly affected. Prior to running any automatic flagging, we will flag these manually. In addition, we will flag the first 9 channels of SPW 0, since this is affected by an issue which causes the noise to be substantially higher:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0:0~8,1:41~63,4')<br />
</source><br />
<br />
Note that this has created a backup flag file called "flagdata_2". Now we apply the antenna position correction and this bandpass calibration to the data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms',<br />
gaintable=['G55.7+3.4_10s.pos', 'G55.7+3.4_10s.initBP'],<br />
calwt=False)<br />
</source><br />
<br />
This operation will flag data that correspond to flagged solutions, so {{applycal}} makes a backup version of the flags prior to operating on the data -- in this case, it's called "before_applycal_1". Note that running {{applycal}} might take a little while, likely around 10 minutes.<br />
<br />
To see the corrected data, we can plot the data as we did before, choosing ydatacolumn='corrected' this time:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
antenna='ea24', xaxis='freq', yaxis='amp', coloraxis='spw',<br />
iteraxis='scan', ydatacolumn='corrected')<br />
</source><br />
<br />
Note that some of the worst RFI is no longer there; also note that the amplitude scale has changed, since the bandpass solutions include amplitude scaling.<br />
<br />
=== Automatic flagging ===<br />
<br />
Now that we have bandpass-corrected data with some of the worst RFI flagged out, we will run <tt>flagdata</tt> in mode='rflag'. Note that there are many parameters which may be modified:<br />
<br />
<source lang="python"><br />
# In CASA<br />
default flagdata<br />
mode='rflag'<br />
inp<br />
</source><br />
<br />
<pre><br />
# flagdata :: All-purpose flagging task based on data-selections and flagging modes/algorithms<br />
vis = '' # Name of MS file to flag<br />
mode = 'rflag' # Flagging mode<br />
# (list/manual/clip/shadow/quack/elevation/tfcrop/rflag/extend/unflag/summary)<br />
field = '' # Field names or field index numbers: '' ==> all, field='0~2,3C286'<br />
spw = '' # Spectral-window/frequency/channel: '' ==> all, spw='0:17~19'<br />
antenna = '' # Antenna/baselines: '' ==> all, antenna ='3,VA04'<br />
timerange = '' # Time range: '' ==> all,timerange='09:14:0~09:54:0'<br />
correlation = '' # Correlation: '' ==> all, correlation='XX,YY'<br />
scan = '' # Scan numbers: '' ==> all<br />
intent = '' # Observation intent: '' ==> all, intent='CAL*POINT*'<br />
array = '' # (Sub)array numbers: '' ==> all<br />
uvrange = '' # UV range: '' ==> all; uvrange ='0~100klambda', default units=meters<br />
observation = '' # Observation ID: '' ==> all<br />
feed = '' # Multi-feed numbers: Not yet implemented<br />
ntime = 'scan' # Time-range to use for each chunk (in seconds or minutes)<br />
combinescans = False # Accumulate data across scans.<br />
datacolumn = 'DATA' # Data column on which to operate (data,corrected,model,residual)<br />
winsize = 3 # Number of timesteps in the sliding time window [aips:fparm(1)]<br />
timedev = '' # Time-series noise estimate [aips:noise]<br />
freqdev = '' # Spectral noise estimate [aips:scutoff]<br />
timedevscale = 5.0 # Threshold scaling for timedev [aips:fparm(9)]<br />
freqdevscale = 5.0 # Threshold scaling for freqdev [aips:fparm(10)]<br />
spectralmax = 1000000.0 # Flag whole spectrum if freqdev is greater than spectralmax [aips:fparm(6)]<br />
spectralmin = 0.0 # Flag whole spectrum if freqdev is less than spectralmin [aips:fparm(5)]<br />
<br />
action = 'apply' # Action to perform in MS and/or in inpfile (none/apply/calculate)<br />
display = '' # Display data and/or end-of-MS reports at runtime (data/report/both).<br />
flagbackup = True # Back up the state of flags before the run<br />
<br />
savepars = False # Save the current parameters to the FLAG_CMD table or to a file<br />
async = False # If true the taskname must be started using flagdata(...)<br />
</pre><br />
<br />
Additional information on the algorithm used in RFlag, as well as the other available automatic flagging algorithm in {{flagdata}} ("TFCrop"), can be found [http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/node5.html on this webpage] (sections 2.1.6 and 2.1.7).<br />
<br />
Following are a set of <tt>flagdata</tt> commands which have been found to work reasonably well with these data. Please take some time to play with the parameters and the plotting capabilities. Since these runs set display='both' and action='calculate', the flags are displayed but not actually written to the MS. This allows one to try different sets of parameters before actually applying the flags to the data.<br />
<br />
Some representative plots are also displayed. Each column displays an individual polarization product; since we're using all four, from left to right are RR, RL, LR, and LL. The first row shows the data with current flags applied, and the second includes the flags generated by <tt>flagdata</tt>. The x-axis is channel number (the spectral window ID is displayed in the top title) and the y-axis of the first two rows is all integrations included in a time "chunk", set by the <tt>ntime</tt> parameter. These are the data considered by the <tt>RFlag</tt> algorithm during its flagging process, and changes in <tt>ntime</tt> will have some (relatively small) affect on what data are flagged. <br />
<br />
Each plot page displays data for a single baseline and time chunk. The buttons at the bottom allow one to step through baseline (backward as well as forward), SPW, scan, and field; "Stop Display" will continue the flagging operation without the GUI, and "Quit" aborts the run.<br />
<br />
First, we will run {{flagdata}} with mode='rflag', using the default parameter values, for just one source (the supernova remnant) and spectral window (0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
While this is clearly picking up some RFI, much is being left untouched (see figure to left, below). After stepping through a few baselines and scans, hit "Quit" to stop the flagger. <br />
<br />
Let's try making it more sensitive to deviations from the calculated RMS in frequency, setting both timedevscale and freqdevscale=1.5 (the default is 5.0):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', field='2', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
[[Image:rflag1.png|200px|thumb|left|flagdata/rflag, default parameters]]<br />
[[Image:rflag2.png|200px|thumb|right|flagdata/rflag, cutoff of 1.5 sigma]]<br />
<br />
Using a cutoff value of 1.5 sigma may seem a bit extreme, but as you can see from the figure on the right, it does a substantially better job of getting rid of the RFI in the badly affected SPW 0.<br />
<br />
We now run {{flagdata}} to calculate and apply these flags for all data in SPW 0. Note that this will take a little while, and flags around 20% of the data:<br />
<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='0', datacolumn='corrected', <br />
freqdevscale=1.5, timedevscale=1.5,<br />
action='apply', display='')<br />
</source><br />
<br />
Although <tt>RFlag</tt> has done a pretty good job of finding the bad data, some still remains. One way to delete it is to use the mode='extend' feature in {{flagdata}}, which can extend flags along a chosen axis. First, we will extend the flags across polarization, so if any one polarization is flagged, all data for that time / channel will be flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, we will extend the flags in time and frequency, using the "growtime" and "growfreq" parameters. For the data here, the <tt>RFlag</tt> algorithm seems most likely to miss RFI which should be flagged along more of the time axis, so we will try with growtime=50.0, which will flag all data for a given channel if more than 50% of that channel's time is already flagged, and growfreq=90.0, which will flag the entire spectrum for an integration if more than 90% of the channels in that integration are already flagged. <br />
<br />
Again, first just have a look at the flags that will be generated before applying them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
It still appears to be missing some RFI, but this is also a very badly-affected SPW, so leave it as is for now and run to apply the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='0', growtime=50.0, growfreq=90.0,<br />
action='apply', display='')<br />
</source><br />
<br />
Now, let's work on SPW 1, flipping through time, baseline, and fields to get a sense of how the flagging will go with these parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='1', datacolumn='corrected', <br />
freqdevscale=2.0, timedevscale=2.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Unfortunately, this SPW is very badly affected by RFI, and it does not seem possible to flag adequately with the automated task (and probably not by hand, either). In this case, we choose to manually flag the entire SPW:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='1')<br />
</source><br />
<br />
Moving on to SPW 2:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='both',<br />
flagbackup=False)<br />
</source><br />
<br />
Since the RFI is narrower and more pronounced in this frequency range, we have increased the RMS cutoff for both the time and frequency calculations to avoid over-flagging and deleting good data. <br />
<br />
After checking the data and changing the parameters until you're happy, apply these flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='2', datacolumn='corrected', <br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
</source><br />
<br />
Again, extend the flags along polarization:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', extendpols=True,<br />
action='apply', display='')<br />
</source><br />
<br />
Try extending in frequency and time, as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good, so let's apply it and have a look in plotms:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='2', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2',<br />
iteraxis='scan', correlation='rr,ll')<br />
</source><br />
<br />
Although we're trying to avoid doing this <i>too</i> much, it appears that there is one baseline which is consistently higher-amplitude than the others, indicating that it's probably contaminated by RFI. Use the plotms tools to identify this baseline, which turns out to be ea04 and ea16, and flag it:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', antenna='ea04&ea16',<br />
spw='2')<br />
</source><br />
<br />
We could have narrowed this further by channel and perhaps time, but remember: this tutorial is about the quick-and-dirty way of flagging data! With this in mind, we move on to SPW 3. Note that this time, we only look at data from the supernova remnant (target) field.<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
The parameters we used for SPW 2 seem to work well for SPW 3 also. Go ahead and flag, then extend as before:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='3', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='3', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
Recall that we already deleted SPW 4 due to bad RFI, so we only have 5-7 remaining. SPWs 5 and 6 have similar RFI properties to 2 and 3, so let's use the same RFlag parameters for these (feel free to play with this a bit yourself, if you like, to try to optimize):<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='5~6', datacolumn='corrected',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='5~6', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
However, SPW 7 is a bit more affected, and we may wish to use a somewhat lower threshold to catch all the RFI. First, try with the same parameters:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=5.0, timedevscale=4.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
Indeed, this seems to be missing a lot of the RFI. Try less stringent limits:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='2',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
This looks pretty good. Check the calibrator sources to be sure it works for them as well:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='1',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected', field='3',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='calculate', display='data',<br />
flagbackup=False)<br />
</source><br />
<br />
These seem reasonable as well, though it's apparent that 3C147 was very affected, possibly because of its low elevation at the time of the observation. Apply and extend the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='rflag', <br />
spw='7', datacolumn='corrected',<br />
freqdevscale=1.0, timedevscale=1.0,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', extendpols=True,<br />
action='apply')<br />
flagdata(vis='G55.7+3.4_10s.ms', mode='extend', <br />
spw='7', growtime=50.0, growfreq=90.0,<br />
action='apply')<br />
</source><br />
<br />
=== Evaluating results & further manual flagging ===<br />
<br />
Now, we will use {{flagdata}} to see a summary of how much data we have flagged:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagInfo = flagdata(vis='G55.7+3.4_10s.ms', mode='summary')<br />
</source><br />
<br />
Using the information stored in the flagInfo Python dictionary, we can calculate and print out some interesting statistics:<br />
<br />
<source lang="python"><br />
# In CASA<br />
print("\n %2.1f%% of G55.7+3.4, %2.1f%% of 3C147, and %2.1f%% of J1925+2106 are flagged. \n" % (100.0 * flagInfo['field']['G55.7+3.4']['flagged'] / flagInfo['field']['G55.7+3.4']['total'], 100.0 * flagInfo['field']['0542+498=3C147']['flagged'] / flagInfo['field']['0542+498=3C147']['total'], 100.0 * flagInfo['field']['J1925+2106']['flagged'] / flagInfo['field']['J1925+2106']['total']))<br />
print("Spectral windows are flagged as follows:")<br />
for spw in range(0,8):<br />
print("SPW %s: %2.1f%%" % (spw, 100.0 * flagInfo['spw'][str(spw)]['flagged'] / flagInfo['spw'][str(spw)]['total']))<br />
<br />
</source><br />
<br />
So, as a result of the flagging thus far, we have sacrificed a bit over half of all the data. Let's see how well it has been cleaned up, using {{plotms}}:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='0,2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
Unfortunately, despite our best autoflagging efforts, SPW 0 still looks pretty bad. (Take heart -- even the by-hand flagging did not work out well for this one.) So, we will flag the rest of SPW 0:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='0')<br />
</source><br />
<br />
[[Image:postflag_scan165.png|200px|thumb|left|after flagging screenshot]]<br />
[[Image:preflag_scan165.png|200px|thumb|right|before flagging screenshot]]<br />
<br />
After this is complete, refresh the plotms window using Shift + Plot. This generates the plot to the left. Just to compare with the unflagged data, we will restore the original flags, and have a look at the same slice. Be sure to save the current flags first!<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='save',<br />
versionname='after_autoflagging_1')<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='flagdata_1')<br />
plotms(vis='G55.7+3.4_10s.ms', scan='165', spw='2~3,5~7',<br />
antenna='ea24', xaxis='freq', yaxis='amp',<br />
correlation='rr,ll', coloraxis='spw')<br />
</source><br />
<br />
The pre-flagging plot is shown on the right. Clearly, a lot of the RFI has been excised. Restore the flags:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagmanager(vis='G55.7+3.4_10s.ms', mode='restore', <br />
versionname='after_autoflagging_1')<br />
</source><br />
<br />
Other instructive ways to view the data are by baseline and <i>uv</i>-distance. Note that we're plotting all baselines in these plots, rather than just baselines to ea24 as before.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='baseline', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
No particular baselines look bad enough to flag outright, so we will leave this as is. Feel free to do some more flagging if you like. Now, let's plot as a function of <i>uv</i>-distance:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', scan='30,75,120,165,190,235,303',<br />
xaxis='uvdist', yaxis='amp', spw='2~3,5~7', iteraxis='spw',<br />
correlation='rr,ll', coloraxis='antenna1')<br />
</source><br />
<br />
Again, nothing really sticks out as obviously in need of flagging. Clearly, there is still some residual RFI left here and there -- however, for the purposes of this tutorial, we will accept the current state of the flags and move on. Feel free to hunt and excise some more, if desired.<br />
<br />
== Calibrating data ==<br />
<br />
Now that we are satisfied with the RFI excision, we will move on to the calibration stage. <br />
<br />
=== Setting the flux density scale ===<br />
<br />
Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run {{setjy}} to set the appropriate model amplitudes for this source. <br />
<br />
If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.<br />
<br />
First, we use the <tt>listmodimages</tt> parameter to find the model image path:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', listmodels=True)<br />
</source><br />
<br />
This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/usr/lib64/casapy/release/nrao/VLA/CalModels". We can optionally give the full path of the model image, but {{setjy}} should now be able to locate it by name alone:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G55.7+3.4_10s.ms', field='0542*', scalebychan=True,<br />
spw='2~3,5~7', modimage='3C147_L.im')<br />
</source><br />
<br />
* scalebychan=True: scales the model flux density value for each channel. By default, only one value per spectral window is calculated.<br />
<br />
=== Bandpass calibration ===<br />
<br />
We will follow the same procedure outlined above for calculating the antenna bandpasses, except that this time, we will use the actual designated bandpass calibration source, 3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. <br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', intent='*BANDPASS*', <br />
caltable='G55.7+3.4_10s.initPh.2',<br />
spw='3;5~6:30~33,2:32~35,7:50~53',<br />
solint='int', refant='ea24',<br />
minblperant=3, minsnr=3.0, calmode='p',<br />
gaintable='G55.7+3.4_10s.pos')<br />
</source><br />
<br />
Unfortunately, you will notice a lot of message that read "Insufficient unflagged antennas to proceed with this solve" for SPW 7. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G55.7+3.4_10s.ms', spw='7')<br />
</source><br />
<br />
Now, on to creating the bandpass calibration for the remaining spectral windows:<br />
<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.bPass',<br />
intent='*BANDPASS*', solint='inf', spw='2~3,5~6',<br />
combine='scan', refant='ea24', minblperant=3, minsnr=10.0,<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.initPh.2'],<br />
interp=['', 'nearest'], solnorm=False)<br />
</source><br />
<br />
* solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna.<br />
<br />
[[Image:Bandpass.amp.png|200px|thumb|right|bandpass amplitudes]]<br />
[[Image:Bandpass.phase.png|200px|thumb|right|bandpass phases]]<br />
<br />
Note that since we have flagged out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='amp',<br />
iteration='antenna', subplot=331)<br />
#<br />
plotcal(caltable='G55.7+3.4_10s.bPass', xaxis='freq', yaxis='phase',<br />
iteration='antenna', subplot=331)<br />
</source><br />
<br />
Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.<br />
<br />
=== Gain calibration ===<br />
<br />
Next, we will calculate the per-antenna gain solutions. Since this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):<br />
<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
intent='*PHASE*,*AMPLI*',<br />
spw='2~3,5~6', solint='inf', refant='ea24', minblperant=3,<br />
minsnr=10.0, gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass'])<br />
</source><br />
<br />
* solint='inf': we request one solution per scan.<br />
<br />
Plot these solutions as a function of time, iterating over antenna:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='amp',<br />
iteration='antenna')<br />
<br />
plotcal(caltable='G55.7+3.4_10s.phaseAmp', xaxis='time', yaxis='phase',<br />
iteration='antenna')<br />
</source><br />
<br />
=== Flux scaling the gain solutions ===<br />
<br />
Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run {{fluxscale}} on the gain table we just created, which will write a new, flux-corrected gain table:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myFlux = fluxscale(vis='G55.7+3.4_10s.ms', caltable='G55.7+3.4_10s.phaseAmp',<br />
fluxtable='G55.7+3.4_10s.phaseAmp.fScale', reference='3')<br />
</source><br />
<br />
Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1925+2106:<br />
<br />
<pre><br />
Found reference field(s): 0542+498=3C147<br />
Found transfer field(s): J1925+2106<br />
Flux density for J1925+2106 in SpW=0 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=1 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=2 is: 1.46169 +/- 0.0285038 (SNR = 51.2806, N = 40)<br />
Flux density for J1925+2106 in SpW=3 is: 1.53198 +/- 0.0250909 (SNR = 61.057, N = 40)<br />
Flux density for J1925+2106 in SpW=4 is: INSUFFICIENT DATA <br />
Flux density for J1925+2106 in SpW=5 is: 1.69898 +/- 0.024897 (SNR = 68.2404, N = 40)<br />
Flux density for J1925+2106 in SpW=6 is: 1.75286 +/- 0.0265399 (SNR = 66.0463, N = 40)<br />
Flux density for J1925+2106 in SpW=7 is: INSUFFICIENT DATA <br />
Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.60707 +/- 0.00474563 (freq=1.50187 GHz) spidx=0.539949 +/- 0.0222143<br />
</pre><br />
<br />
The flux density listed in the [http://www.vla.nrao.edu/astro/calib/manual/csource.html VLA Calibrator Manual] for this source is around the same magnitude:<br />
<br />
<pre><br />
1925+211 J2000 A 19h25m59.605370s 21d06'26.162180" Aug01 <br />
1923+210 B1950 A 19h23m49.792400s 21d00'23.305000"<br />
-----------------------------------------------------<br />
BAND A B C D FLUX(Jy) UVMIN(kL) UVMAX(kL)<br />
=====================================================<br />
20cm L P S S S 1.30 visplot<br />
</pre><br />
<br />
So we should be satisfied that our calibration up to this point is reasonable.<br />
<br />
=== Applying calibration ===<br />
<br />
Finally, we must apply the calibration to our data. To do this, we run {{applycal}} in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" for the application to the science target:<br />
<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*TARGET*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], calwt=False)<br />
#<br />
applycal(vis='G55.7+3.4_10s.ms', spw='2~3,5~6', intent='*PHASE*,*AMPLI*',<br />
gaintable=['G55.7+3.4_10s.pos','G55.7+3.4_10s.bPass', \<br />
'G55.7+3.4_10s.phaseAmp.fScale'], \<br />
calwt=False, interp=['','nearest','nearest'])<br />
</source><br />
<br />
=== Plotting calibrated data ===<br />
<br />
[[Image:J1925+2106.corr.phase.png|200px|thumb|right|J1925+2106 corrected amplitude vs. phase]]<br />
[[Image:J1925+2106.corr.baseline.png|200px|thumb|right|J1925+2106 corrected amplitude vs. baseline]]<br />
[[Image:3C147.corr.phase.png|200px|thumb|right|3C147 corrected amplitude vs. phase]]<br />
[[Image:3C147.corr.baseline.png|200px|thumb|right|3C147 corrected amplitude vs. baseline]]<br />
<br />
<br />
To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in {{plotms}}. A very useful way to check the goodness of calibration is to plot the corrected amplitude vs. corrected phase (which should look like a tight ball for a point source, and will have organized structure if the source is resolved), and corrected amplitude vs. baseline, which should be a flat line of points for a point source, and will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. <i>uv</i>-distance.<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='1', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='phase', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
#<br />
plotms(vis='G55.7+3.4_10s.ms', field='3', xaxis='baseline', yaxis='amp',<br />
xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',<br />
avgchannel='10', avgtime='20', correlation='rr,ll', iteraxis='spw',<br />
spw='2~3,5~6')<br />
</source><br />
<br />
=== Splitting out data for G55.7+3.4 ===<br />
<br />
Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task {{split}}. This will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.<br />
<br />
<source lang="python"><br />
# In CASA<br />
split(vis='G55.7+3.4_10s.ms', field='2', keepflags=False,<br />
outputvis='G55.7+3.4.calib.ms', datacolumn='corrected',<br />
spw='2~3,5~6', correlation = 'rr,ll')<br />
</source><br />
<br />
== Imaging ==<br />
<br />
<!-- At this point, one may image either the resulting MS from the flagging and calibration steps above, or the MS that was flagged by hand and calibrated. The latter is available as "G55.7+3.4.byHandFlag.ms". (For internal, pre-workshop testers: the data can be found at <tt>/lustre/sbhatnag/Tests/ThursdayLectures/G55.7+3.4_10s_Calib.ms</tt>.) For this tutorial, we will use the MS that has been produced using <tt>testautoflag</tt> and the minimal amount of manual flagging described here, with the exception of the final clean step, where we will run identical commands on both sets of data and compare the results. --><br />
<br />
The size of the primary beam is 45 arcmin divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the [https://science.nrao.edu/facilities/vla/docs/manuals/oss2012b/performance/resolution Observational Status Summary]'s section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec. <br />
<br />
Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.<br />
<br />
First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:<br />
<br />
<math><br />
\Delta(S) = S(R) \times PB(R) \times PSF(R)<br />
</math><br />
<br />
So, for R = 1 degree, source flux S(R) = 1 Jy, <math>\Delta(S)</math> = 1 mJy − 100 <math>{\mu}</math>Jy. Clearly, this will be a source of significant error.<br />
<br />
=== Multi-scale clean ===<br />
<br />
[[Image:multiscale.G55.png|100px|thumb|right|G55.7+3.4 multiscale clean]]<br />
<br />
Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use {{clean}} with multiple scales. As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources. <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are currently implementing a command that will nicely exit to prevent this from happening, but for the moment try to avoid Ctrl+C.'''<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.multiScale',<br />
imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],<br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.multiScale.image')<br />
</source><br />
<br />
* imagename='G55.7+3.4.multiScale': the root filename used for the various {{clean}} outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).<br />
<br />
* imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.<br />
<br />
* cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.<br />
<br />
* multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.<br />
<br />
* interactive=False: we will let {{clean}} use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.<br />
<br />
* niter=1000: this controls the number of iterations {{clean}} will do in the minor cycle. <br />
<br />
* weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).<br />
<br />
* calready=F: do not write the model visibilities to the model data column (only needed for self-calibration)<br />
<br />
* imagermode='csclean': use the Cotton-Schwab clean algorithm<br />
<br />
[[Image:multiscale.artifact.png|100px|thumb|right|artifacts around point source]]<br />
<br />
* stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.<br />
<br />
* threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the [https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure/evlaExpoCalc.jnlp EVLA exposure calculator]. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.<br />
<br />
This is the fastest of the imaging techniques described here (it will probably take less than ten minutes to complete), but it's easy to see that there are artifacts in the resulting image. For example, use the {{viewer}} to explore the point sources near the edge of the field. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Next we will explore some more advanced imaging techniques to mitigate these artifacts.<br />
<br />
=== Multi-scale, wide-field clean ===<br />
<br />
The next {{clean}} algorithm we will employ is W-projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For more details on the motivation for this correction, as well as the algorithm itself, see [http://adsabs.harvard.edu/abs/2008ISTSP...2..647C "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm"].<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec',<br />
wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.wProj.image')<br />
</source><br />
<br />
[[Image:widefield.artifact.png|100px|thumb|right|w-projection improvements]]<br />
<br />
* gridmode='widefield': use the W-projection algorithm.<br />
<br />
* wprojplanes=128: the number of W-projection planes to use for deconvolution; 128 is the minimum recommended number.<br />
<br />
This will take longer than the previous imaging round (likely around 15 minutes); however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-projected image with the multi-scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.<br />
<br />
=== Multi-scale, multi-frequency synthesis ===<br />
<br />
Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms. <br />
<br />
If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.<br />
<br />
The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. <br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS',<br />
imsize=1280, cell='8arcsec', mode='mfs', nterms=2,<br />
multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.artifact.png|100px|thumb|right|artifacts with nterms=2]]<br />
<br />
* nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).<br />
<br />
This will take a little while (likely around 30 minutes), so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point. <br />
<br />
When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the [http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf CASA cookbook]. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.<br />
<br />
=== Multi-scale, multi-frequency, wide-field clean ===<br />
<br />
Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.<br />
<br />
First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single {{clean}} run, we have:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
[[Image:mfs.wproj.artifact.png|100px|thumb|right|artifacts with nterms=2, wide-field]]<br />
<br />
Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use). <br />
<br />
Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with {{plotms}}. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.<br />
<br />
<!-- Finally, imaging the data which were flagged by hand (these can be found in the same directory as the unflagged data), and using the same parameters as before (again, this will probably take around an hour):<br />
<br />
[[Image:mfs.wproj.auto.png|200px|thumb|left|nterms=2, wide-field, auto-flagging]]<br />
<br />
[[Image:mfs.wproj.byhand.png|200px|thumb|right|nterms=2, wide-field, by-hand flagging]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
clean(vis='G55.7+3.4.byHandFlag.ms',<br />
imagename='G55.7+3.4.byHand.MS.MFS.wProj',<br />
gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',<br />
nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60], <br />
interactive=False, niter=1000, weighting='briggs',<br />
stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.tt0')<br />
viewer('G55.7+3.4.byHand.MS.MFS.wProj.image.alpha')<br />
</source><br />
<br />
Comparing the images using the two different data sets, we can see that there is still a substantial improvement in image fidelity using the by-hand-flagged data. This isn't too surprising, since our {{plotms}} displays showed that there was still some RFI present, and it's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms. --><br />
<br />
<br />
{{Checked 4.1.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15541EVLA 3-bit Tutorial G192-CASA4.22014-02-05T04:59:51Z<p>Knyland: /* Cleaning both basebands using two MFS Taylor terms */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 4 times <br />
* Draw a box the point-like source and double-click inside the box to set your clean box (or clean "mask")<br />
Change the number of iterations on the upper left to 50. (Note: this number is independent from the niter clean parameter, which applies to cleaning in mode interactive = False and is used if you click the right-pointing arrow button on the upper right to continue cleaning non-interactively.)<br />
* The curved arrow on the upper right should now be highlighted in green. Click this green icon to clean the boxed source.<br />
* Stop cleaning when the residuals look like the noise (this will probably happen after the first 50-100 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
In this particular case, it's 136 uJy; yours may be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0]) + ' Jy'<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
The deconvolved size of around 51.3 x 37.7 milliarcseconds corresponds to a size of roughly 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0]) + ' Jy'<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is slights extended and provides a deconvolved size. To the right is a zoomed-in image of the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt>. Note: if you prefer, you can clean your image using interactive = False. For non-interactive cleaning, make sure you define a clean mask with <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. You can also draw a new region file from scratch in the Viewer, save the region as a .crtf file, and supply this file to the mask parameter in clean. If you set interactive = False you should also modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning (the threshold parameter should always be higher than the expected theoretical rms noise; for an estimation of the rms noise for this image see below).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0') + ' Jy'<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf') + ' Jy'<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15540EVLA 3-bit Tutorial G192-CASA4.22014-02-05T04:53:38Z<p>Knyland: /* Cleaning the upper-frequency baseband */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 4 times <br />
* Draw a box the point-like source and double-click inside the box to set your clean box (or clean "mask")<br />
Change the number of iterations on the upper left to 50. (Note: this number is independent from the niter clean parameter, which applies to cleaning in mode interactive = False and is used if you click the right-pointing arrow button on the upper right to continue cleaning non-interactively.)<br />
* The curved arrow on the upper right should now be highlighted in green. Click this green icon to clean the boxed source.<br />
* Stop cleaning when the residuals look like the noise (this will probably happen after the first 50-100 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
In this particular case, it's 136 uJy; yours may be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0]) + ' Jy'<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
The deconvolved size of around 51.3 x 37.7 milliarcseconds corresponds to a size of roughly 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0]) + ' Jy'<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is slights extended and provides a deconvolved size. To the right is a zoomed-in image of the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt> Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. In this case, you should modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15539EVLA 3-bit Tutorial G192-CASA4.22014-02-05T04:52:06Z<p>Knyland: /* Cleaning the upper-frequency baseband */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 4 times <br />
* Draw a box the point-like source and double-click inside the box to set your clean box (or clean "mask")<br />
Change the number of iterations on the upper left to 50. (Note: this number is independent from the niter clean parameter, which applies to cleaning in mode interactive = False and is used if you click the right-pointing arrow button on the upper right to continue cleaning non-interactively.)<br />
* The curved arrow on the upper right should now be highlighted in green. Click this green icon to clean the boxed source.<br />
* Stop cleaning when the residuals look like the noise (this will probably happen after the first 50-100 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
In this particular case, it's 136 uJy; yours may be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0]) + ' Jy'<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
The deconvolved size of around 51.3 x 37.7 milliarcseconds corresponds to a size of roughly 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0]) + ' Jy'<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is extended. To the right is a zoom-in on the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt> Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. In this case, you should modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15538EVLA 3-bit Tutorial G192-CASA4.22014-02-05T04:49:51Z<p>Knyland: /* Cleaning the lower-frequency baseband */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 4 times <br />
* Draw a box the point-like source and double-click inside the box to set your clean box (or clean "mask")<br />
Change the number of iterations on the upper left to 50. (Note: this number is independent from the niter clean parameter, which applies to cleaning in mode interactive = False and is used if you click the right-pointing arrow button on the upper right to continue cleaning non-interactively.)<br />
* The curved arrow on the upper right should now be highlighted in green. Click this green icon to clean the boxed source.<br />
* Stop cleaning when the residuals look like the noise (this will probably happen after the first 50-100 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
In this particular case, it's 136 uJy; yours may be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0]) + ' Jy'<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
The deconvolved size of around 51.3 x 37.7 milliarcseconds corresponds to a size of roughly 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is extended. To the right is a zoom-in on the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt> Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. In this case, you should modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15537EVLA 3-bit Tutorial G192-CASA4.22014-02-05T04:36:17Z<p>Knyland: /* Cleaning a single spectral window */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 4 times <br />
* Draw a box the point-like source and double-click inside the box to set your clean box (or clean "mask")<br />
Change the number of iterations on the upper left to 50. (Note: this number is independent from the niter clean parameter, which applies to cleaning in mode interactive = False and is used if you click the right-pointing arrow button on the upper right to continue cleaning non-interactively.)<br />
* The curved arrow on the upper right should now be highlighted in green. Click this green icon to clean the boxed source.<br />
* Stop cleaning when the residuals look like the noise (this will probably happen after the first 50-100 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
In this particular case, it's 136 uJy; yours may be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
Although it appears point-like, G192 is actually resolved! The deconvolved size of around 45 milliarcseconds corresponds to a size of 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is extended. To the right is a zoom-in on the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt> Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. In this case, you should modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15536EVLA 3-bit Tutorial G192-CASA4.22014-02-05T04:32:50Z<p>Knyland: /* Cleaning a single spectral window */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 4 times <br />
* Draw a box the point-like source and double-click inside the box to set your clean box (or clean "mask")<br />
* The curved arrow on the upper right should now be highlighted in green. Click this green icon to clean the boxed source.<br />
* Stop cleaning when the residuals look like the noise (this will probably happen after the first 50-100 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
In this particular case, it's 136 uJy; yours may be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
Although it appears point-like, G192 is actually resolved! The deconvolved size of around 45 milliarcseconds corresponds to a size of 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is extended. To the right is a zoom-in on the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt> Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. In this case, you should modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15535EVLA 3-bit Tutorial G192-CASA4.22014-02-05T04:26:05Z<p>Knyland: /* Cleaning a single spectral window */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 4 times <br />
* Box the point-like source and double-click inside the box to set clean box<br />
* The curved arrow on the upper right should now be highlighted in green. Click this green icon to clean the boxed source.<br />
* Stop cleaning when the residuals look like noise (this will probably happen after the first 50-100 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0]) + ' Jy'<br />
</source><br />
In this particular case, it's 136 uJy; yours may be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
Although it appears point-like, G192 is actually resolved! The deconvolved size of around 45 milliarcseconds corresponds to a size of 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is extended. To the right is a zoom-in on the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt> Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. In this case, you should modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knylandhttps://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192-CASA4.2&diff=15505EVLA 3-bit Tutorial G192-CASA4.22014-02-04T23:43:33Z<p>Knyland: /* Cleaning a single spectral window */</p>
<hr />
<div>This is an advanced Jansky VLA data reduction tutorial that calibrates and images a 3-bit dataset.<br />
<br />
<b>This CASA Guide is for CASA version 4.1.0.</b><br />
[[EVLA_3-bit_Tutorial_G192-CASA4.2]]<br />
== Overview ==<br />
<br />
This article describes the calibration and imaging of the protostar G192.16-3.84. The data were taken in Ka-band using the VLA's 3-bit samplers and widely-spaced basebands centered at 29 and 36.5 GHz. Each baseband has over 4 GHz of bandwidth comprised of 32 128-MHz spectral windows. In this tutorial, we will examine, flag, and calibrate the data, including the corrections for the requantizer gains (which are necessary for 3-bit data calibration and harmless on 8-bit data). We will then image and analyze the calibrated data, using wideband imaging techniques.<br />
<br />
This is a more advanced tutorial, so if you are a relative novice, it is <em>strongly</em> recommended that you start with the [[EVLA Continuum Tutorial 3C391]] (at least read it through) before proceeding with this tutorial.<br />
<br />
In addition, on the [http://casaguides.nrao.edu MainPage] of the CASA Guides you can find these helpful pages:<br />
* [[What is CASA?]]<br />
* [[Getting Started in CASA]]<br />
* [[CASA Reference Manuals]]<br />
* [[Hints, Tips, & Tricks]]<br />
* [[AIPS-to-CASA Cheat Sheet]]<br />
<br />
In this tutorial we will be invoking the tasks as function calls. You can cut and paste these to your casapy session. We also recommend that you copy all the commands you use, with any relevant commentary, to a text file. This is ''very'' good practice when tackling large datasets. If you wish, you can use the [http://casaguides.nrao.edu/index.php?title=Extracting_scripts_from_these_tutorials Script Extractor] to create a file with the tutorial commands, which can subsequently be edited and annotated as desired.<br />
<br />
Occasionally we will be setting Python variables (e.g., as lists for flags) outside the function call so make sure you set those before running the task command. Note that when you call a CASA task as a function, any task parameters that are not set in the function call will be used with their default values. This means they will ''not'' use values you set in any previous calls or outside the call. See [[Getting_Started_in_CASA#Task_Execution]] for more on calling tasks and setting parameters in the scripting interface.<br />
<br />
NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, you can adjust the width of the browser window.<br />
<br />
== Obtaining the Data ==<br />
<br />
The data for this tutorial were taken with the VLA during its commissioning phase. They comprise the scheduling block (SB) <tt>TVER0004.sb14459364.eb14492359.56295.26287841435</tt>, which was run on 2013-01-03 from 6:18 to 7:47 UT (its raw size is 57.04 GB). <br />
<br />
The data can be downloaded directly from [http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz http://casa.nrao.edu/Data/EVLA/G192/G192_6s.ms.tar.gz] (dataset size: 18 GB)<br />
<br />
Your first step will be to unzip and untar the file in a terminal (before you start CASA):<br />
<br />
<source lang="bash"><br />
tar -xzvf G192_6s.ms.tar.gz <br />
</source><br />
<br />
If you are brave enough, you can also get the data directly from the VLA archive. Go to the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive], and search for "TVER0004.sb14459364" in the Archive File ID field. Then select the dataset and choose a time-averaging value of 6 seconds. (Although the data were taken in A-configuration, we will not be imaging outside of the center of the field, so we aren't too worried about time-average smearing and will take advantage of averaging to reduce the dataset size.) Also select the "Create tar file" option.<br />
<br />
In addition, only the fields used for analysis and observation are included in the downloadable file. This can be accomplished using the {{split}} task in CASA:<br />
<source lang="python"><br />
# In CASA<br />
split('TVER0004.sb14459364.eb14492359.56295.26287841435.ms', outputvis='G192_6s.ms', \<br />
datacolumn='all', field='3,6,7,10', keepflags=False, spw='2~65')<br />
</source><br />
<br />
(If you're downloading from the archive and feeling ambitious, you could also select only the scans with fields 3, 6, 7, and 10 in the "Select scans for MS or AIPS FITS" box.) This will create a file equivalent to what is used at the start of this tutorial.<br />
<br />
Finally, you will need to modify some information in the SOURCE and FIELD tables of the measurement set (this has already been done for you in the file available for download, but must be done by hand if obtaining from the archive). Follow [http://casaguides.nrao.edu/index.php?title=Modifying_SOURCE_and_FIELD_tables the instructions here] to make these changes.<br />
<br />
== Starting CASA ==<br />
<br />
To start CASA, type:<br />
<br />
<source lang="bash"><br />
casapy<br />
</source><br />
<br />
This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython-<unique-stamp>.log, which will contain a record of all the text you enter at the CASA prompt, as well as casapy-<unique-stamp>.log, which will contain all the messages that are printed to the CASA logger window. It is recommended that you keep your log files in tact - you may need them to remind you of the last step you completed in your data reduction! (It is also a good idea to include your log files when submitting a help desk ticket).<br />
<br />
Once CASA has started, a logger window will appear. Note that you can rescale this window or change the font size as desired (the latter is under "View").<br />
<br />
== Examining the Measurement Set (MS) ==<br />
<br />
We use {{listobs}} to summarize our MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_6s.ms', listfile='G192_listobs.txt')<br />
</source><br />
<br />
This will write the output to a file called <tt>G192_listobs.txt</tt>, which we can print to the terminal using the <tt>cat</tt> command:<br />
<br />
<source lang="python"><br />
# In CASA<br />
cat G192_listobs.txt<br />
</source><br />
<br />
<pre><br />
================================================================================<br />
MeasurementSet Name: /lustre/knyland/casa_guides/protostar/G192_6s.ms MS Version 2<br />
================================================================================<br />
Observer: Dr. Debra Shepherd Project: uid://evla/pdb/7303457 <br />
Observation: EVLA<br />
Data records: 10061248 Total integration time = 4557 seconds<br />
Observed from 03-Jan-2013/06:31:51.0 to 03-Jan-2013/07:47:48.0 (UTC)<br />
<br />
ObservationID = 0 ArrayID = 0<br />
Date Timerange (UTC) Scan FldId FieldName nRows SpwIds Average Interval(s) ScanIntent<br />
03-Jan-2013/06:31:48.0 - 06:36:42.0 6 0 3C147 1019200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5.94, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_FLUX#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:46:15.0 - 06:46:54.0 10 1 gcal-J0603+174 145600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57, 5.57] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:47:09.0 - 06:47:54.0 11 2 G192.16-3.84 163200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:06.0 - 06:48:39.0 12 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:48:51.0 - 06:49:39.0 13 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:49:51.0 - 06:50:24.0 14 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:50:36.0 - 06:51:24.0 15 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:51:36.0 - 06:52:09.0 16 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:52:19.5 - 06:53:09.0 17 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:53:21.0 - 06:53:54.0 18 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:54:06.0 - 06:54:54.0 19 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:06.0 - 06:55:39.0 20 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:55:51.0 - 06:56:39.0 21 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:56:51.0 - 06:57:24.0 22 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:57:36.0 - 06:58:24.0 23 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
06:58:36.0 - 06:59:12.0 24 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
06:59:21.0 - 07:00:12.0 25 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:00:19.5 - 07:00:57.0 26 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:01:06.0 - 07:01:57.0 27 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:03.0 - 07:02:42.0 28 1 gcal-J0603+174 125184 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:02:48.0 - 07:03:36.0 29 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:03:48.0 - 07:04:21.0 30 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:04:33.0 - 07:05:21.0 31 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:05:33.0 - 07:06:06.0 32 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:06:18.0 - 07:07:06.0 33 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:07:18.0 - 07:07:51.0 34 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:08:03.0 - 07:08:51.0 35 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:03.0 - 07:09:36.0 36 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:09:48.0 - 07:10:36.0 37 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:10:46.5 - 07:11:21.0 38 1 gcal-J0603+174 123200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49, 5.49] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:11:33.0 - 07:12:21.0 39 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:12:33.0 - 07:13:06.0 40 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:13:18.0 - 07:14:06.0 41 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:14:16.5 - 07:14:51.0 42 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:15:01.5 - 07:15:51.0 43 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:03.0 - 07:16:36.0 44 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:16:48.0 - 07:17:39.0 45 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:17:48.0 - 07:18:24.0 46 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:18:33.0 - 07:19:24.0 47 2 G192.16-3.84 187200 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67, 5.67] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:19:30.0 - 07:20:09.0 48 1 gcal-J0603+174 124864 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:20:18.0 - 07:21:06.0 49 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:21:15.0 - 07:21:48.0 50 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:22:00.0 - 07:22:48.0 51 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:00.0 - 07:23:33.0 52 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:23:45.0 - 07:24:33.0 53 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:24:45.0 - 07:25:18.0 54 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:25:30.0 - 07:26:18.0 55 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:26:30.0 - 07:27:03.0 56 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:27:15.0 - 07:28:03.0 57 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:28:15.0 - 07:28:48.0 58 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:29:00.0 - 07:29:48.0 59 2 G192.16-3.84 166400 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [OBSERVE_TARGET#UNSPECIFIED]<br />
07:30:00.0 - 07:30:33.0 60 1 gcal-J0603+174 124800 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5] [CALIBRATE_AMPLI#UNSPECIFIED, CALIBRATE_PHASE#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
07:40:27.0 - 07:47:51.0 64 3 3c84-J0319+413 1537600 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] [CALIBRATE_BANDPASS#UNSPECIFIED, OBSERVE_TARGET#UNSPECIFIED]<br />
(nRows = Total number of rows per scan) <br />
Fields: 4<br />
ID Code Name RA Decl Epoch SrcId nRows<br />
0 E 3C147 05:42:36.137916 +49.51.07.23356 J2000 0 1019200<br />
1 D gcal-J0603+174 06:03:09.130269 +17.42.16.81070 J2000 1 3264448<br />
2 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 2 4240000<br />
3 F 3c84-J0319+413 03:19:48.160102 +41.30.42.10305 J2000 3 1537600<br />
Spectral Windows: (64 unique spectral windows and 1 unique polarization setups)<br />
SpwID Name #Chans Frame Ch0(MHz) ChanWid(kHz) TotBW(kHz) BBC Num Corrs <br />
0 EVLA_KA#A1C1#2 128 TOPO 34476.000 1000.000 128000.0 10 RR LL<br />
1 EVLA_KA#A1C1#3 128 TOPO 34604.000 1000.000 128000.0 10 RR LL<br />
2 EVLA_KA#A1C1#4 128 TOPO 34732.000 1000.000 128000.0 10 RR LL<br />
3 EVLA_KA#A1C1#5 128 TOPO 34860.000 1000.000 128000.0 10 RR LL<br />
4 EVLA_KA#A1C1#6 128 TOPO 34988.000 1000.000 128000.0 10 RR LL<br />
5 EVLA_KA#A1C1#7 128 TOPO 35116.000 1000.000 128000.0 10 RR LL<br />
6 EVLA_KA#A1C1#8 128 TOPO 35244.000 1000.000 128000.0 10 RR LL<br />
7 EVLA_KA#A1C1#9 128 TOPO 35372.000 1000.000 128000.0 10 RR LL<br />
8 EVLA_KA#A1C1#10 128 TOPO 35500.000 1000.000 128000.0 10 RR LL<br />
9 EVLA_KA#A1C1#11 128 TOPO 35628.000 1000.000 128000.0 10 RR LL<br />
10 EVLA_KA#A1C1#12 128 TOPO 35756.000 1000.000 128000.0 10 RR LL<br />
11 EVLA_KA#A1C1#13 128 TOPO 35884.000 1000.000 128000.0 10 RR LL<br />
12 EVLA_KA#A1C1#14 128 TOPO 36012.000 1000.000 128000.0 10 RR LL<br />
13 EVLA_KA#A1C1#15 128 TOPO 36140.000 1000.000 128000.0 10 RR LL<br />
14 EVLA_KA#A1C1#16 128 TOPO 36268.000 1000.000 128000.0 10 RR LL<br />
15 EVLA_KA#A1C1#17 128 TOPO 36396.000 1000.000 128000.0 10 RR LL<br />
16 EVLA_KA#A2C2#18 128 TOPO 36476.000 1000.000 128000.0 11 RR LL<br />
17 EVLA_KA#A2C2#19 128 TOPO 36604.000 1000.000 128000.0 11 RR LL<br />
18 EVLA_KA#A2C2#20 128 TOPO 36732.000 1000.000 128000.0 11 RR LL<br />
19 EVLA_KA#A2C2#21 128 TOPO 36860.000 1000.000 128000.0 11 RR LL<br />
20 EVLA_KA#A2C2#22 128 TOPO 36988.000 1000.000 128000.0 11 RR LL<br />
21 EVLA_KA#A2C2#23 128 TOPO 37116.000 1000.000 128000.0 11 RR LL<br />
22 EVLA_KA#A2C2#24 128 TOPO 37244.000 1000.000 128000.0 11 RR LL<br />
23 EVLA_KA#A2C2#25 128 TOPO 37372.000 1000.000 128000.0 11 RR LL<br />
24 EVLA_KA#A2C2#26 128 TOPO 37500.000 1000.000 128000.0 11 RR LL<br />
25 EVLA_KA#A2C2#27 128 TOPO 37628.000 1000.000 128000.0 11 RR LL<br />
26 EVLA_KA#A2C2#28 128 TOPO 37756.000 1000.000 128000.0 11 RR LL<br />
27 EVLA_KA#A2C2#29 128 TOPO 37884.000 1000.000 128000.0 11 RR LL<br />
28 EVLA_KA#A2C2#30 128 TOPO 38012.000 1000.000 128000.0 11 RR LL<br />
29 EVLA_KA#A2C2#31 128 TOPO 38140.000 1000.000 128000.0 11 RR LL<br />
30 EVLA_KA#A2C2#32 128 TOPO 38268.000 1000.000 128000.0 11 RR LL<br />
31 EVLA_KA#A2C2#33 128 TOPO 38396.000 1000.000 128000.0 11 RR LL<br />
32 EVLA_KA#B1D1#34 128 TOPO 26976.000 1000.000 128000.0 13 RR LL<br />
33 EVLA_KA#B1D1#35 128 TOPO 27104.000 1000.000 128000.0 13 RR LL<br />
34 EVLA_KA#B1D1#36 128 TOPO 27232.000 1000.000 128000.0 13 RR LL<br />
35 EVLA_KA#B1D1#37 128 TOPO 27360.000 1000.000 128000.0 13 RR LL<br />
36 EVLA_KA#B1D1#38 128 TOPO 27488.000 1000.000 128000.0 13 RR LL<br />
37 EVLA_KA#B1D1#39 128 TOPO 27616.000 1000.000 128000.0 13 RR LL<br />
38 EVLA_KA#B1D1#40 128 TOPO 27744.000 1000.000 128000.0 13 RR LL<br />
39 EVLA_KA#B1D1#41 128 TOPO 27872.000 1000.000 128000.0 13 RR LL<br />
40 EVLA_KA#B1D1#42 128 TOPO 28000.000 1000.000 128000.0 13 RR LL<br />
41 EVLA_KA#B1D1#43 128 TOPO 28128.000 1000.000 128000.0 13 RR LL<br />
42 EVLA_KA#B1D1#44 128 TOPO 28256.000 1000.000 128000.0 13 RR LL<br />
43 EVLA_KA#B1D1#45 128 TOPO 28384.000 1000.000 128000.0 13 RR LL<br />
44 EVLA_KA#B1D1#46 128 TOPO 28512.000 1000.000 128000.0 13 RR LL<br />
45 EVLA_KA#B1D1#47 128 TOPO 28640.000 1000.000 128000.0 13 RR LL<br />
46 EVLA_KA#B1D1#48 128 TOPO 28768.000 1000.000 128000.0 13 RR LL<br />
47 EVLA_KA#B1D1#49 128 TOPO 28896.000 1000.000 128000.0 13 RR LL<br />
48 EVLA_KA#B2D2#50 128 TOPO 28976.000 1000.000 128000.0 14 RR LL<br />
49 EVLA_KA#B2D2#51 128 TOPO 29104.000 1000.000 128000.0 14 RR LL<br />
50 EVLA_KA#B2D2#52 128 TOPO 29232.000 1000.000 128000.0 14 RR LL<br />
51 EVLA_KA#B2D2#53 128 TOPO 29360.000 1000.000 128000.0 14 RR LL<br />
52 EVLA_KA#B2D2#54 128 TOPO 29488.000 1000.000 128000.0 14 RR LL<br />
53 EVLA_KA#B2D2#55 128 TOPO 29616.000 1000.000 128000.0 14 RR LL<br />
54 EVLA_KA#B2D2#56 128 TOPO 29744.000 1000.000 128000.0 14 RR LL<br />
55 EVLA_KA#B2D2#57 128 TOPO 29872.000 1000.000 128000.0 14 RR LL<br />
56 EVLA_KA#B2D2#58 128 TOPO 30000.000 1000.000 128000.0 14 RR LL<br />
57 EVLA_KA#B2D2#59 128 TOPO 30128.000 1000.000 128000.0 14 RR LL<br />
58 EVLA_KA#B2D2#60 128 TOPO 30256.000 1000.000 128000.0 14 RR LL<br />
59 EVLA_KA#B2D2#61 128 TOPO 30384.000 1000.000 128000.0 14 RR LL<br />
60 EVLA_KA#B2D2#62 128 TOPO 30512.000 1000.000 128000.0 14 RR LL<br />
61 EVLA_KA#B2D2#63 128 TOPO 30640.000 1000.000 128000.0 14 RR LL<br />
62 EVLA_KA#B2D2#64 128 TOPO 30768.000 1000.000 128000.0 14 RR LL<br />
63 EVLA_KA#B2D2#65 128 TOPO 30896.000 1000.000 128000.0 14 RR LL<br />
Sources: 256<br />
ID Name SpwId RestFreq(MHz) SysVel(km/s) <br />
0 3C147 0 - - <br />
0 3C147 1 - - <br />
0 3C147 2 - - <br />
0 3C147 3 - - <br />
0 3C147 4 - - <br />
0 3C147 5 - - <br />
0 3C147 6 - - <br />
0 3C147 7 - - <br />
0 3C147 8 - - <br />
0 3C147 9 - - <br />
0 3C147 10 - - <br />
0 3C147 11 - - <br />
0 3C147 12 - - <br />
0 3C147 13 - - <br />
0 3C147 14 - - <br />
0 3C147 15 - - <br />
0 3C147 16 - - <br />
0 3C147 17 - - <br />
0 3C147 18 - - <br />
0 3C147 19 - - <br />
0 3C147 20 - - <br />
0 3C147 21 - - <br />
0 3C147 22 - - <br />
0 3C147 23 - - <br />
0 3C147 24 - - <br />
0 3C147 25 - - <br />
0 3C147 26 - - <br />
0 3C147 27 - - <br />
0 3C147 28 - - <br />
0 3C147 29 - - <br />
0 3C147 30 - - <br />
0 3C147 31 - - <br />
0 3C147 32 - - <br />
0 3C147 33 - - <br />
0 3C147 34 - - <br />
0 3C147 35 - - <br />
0 3C147 36 - - <br />
0 3C147 37 - - <br />
0 3C147 38 - - <br />
0 3C147 39 - - <br />
0 3C147 40 - - <br />
0 3C147 41 - - <br />
0 3C147 42 - - <br />
0 3C147 43 - - <br />
0 3C147 44 - - <br />
0 3C147 45 - - <br />
0 3C147 46 - - <br />
0 3C147 47 - - <br />
0 3C147 48 - - <br />
0 3C147 49 - - <br />
0 3C147 50 - - <br />
0 3C147 51 - - <br />
0 3C147 52 - - <br />
0 3C147 53 - - <br />
0 3C147 54 - - <br />
0 3C147 55 - - <br />
0 3C147 56 - - <br />
0 3C147 57 - - <br />
0 3C147 58 - - <br />
0 3C147 59 - - <br />
0 3C147 60 - - <br />
0 3C147 61 - - <br />
0 3C147 62 - - <br />
0 3C147 63 - - <br />
1 gcal-J0603+174 0 - - <br />
1 gcal-J0603+174 1 - - <br />
1 gcal-J0603+174 2 - - <br />
1 gcal-J0603+174 3 - - <br />
1 gcal-J0603+174 4 - - <br />
1 gcal-J0603+174 5 - - <br />
1 gcal-J0603+174 6 - - <br />
1 gcal-J0603+174 7 - - <br />
1 gcal-J0603+174 8 - - <br />
1 gcal-J0603+174 9 - - <br />
1 gcal-J0603+174 10 - - <br />
1 gcal-J0603+174 11 - - <br />
1 gcal-J0603+174 12 - - <br />
1 gcal-J0603+174 13 - - <br />
1 gcal-J0603+174 14 - - <br />
1 gcal-J0603+174 15 - - <br />
1 gcal-J0603+174 16 - - <br />
1 gcal-J0603+174 17 - - <br />
1 gcal-J0603+174 18 - - <br />
1 gcal-J0603+174 19 - - <br />
1 gcal-J0603+174 20 - - <br />
1 gcal-J0603+174 21 - - <br />
1 gcal-J0603+174 22 - - <br />
1 gcal-J0603+174 23 - - <br />
1 gcal-J0603+174 24 - - <br />
1 gcal-J0603+174 25 - - <br />
1 gcal-J0603+174 26 - - <br />
1 gcal-J0603+174 27 - - <br />
1 gcal-J0603+174 28 - - <br />
1 gcal-J0603+174 29 - - <br />
1 gcal-J0603+174 30 - - <br />
1 gcal-J0603+174 31 - - <br />
1 gcal-J0603+174 32 - - <br />
1 gcal-J0603+174 33 - - <br />
1 gcal-J0603+174 34 - - <br />
1 gcal-J0603+174 35 - - <br />
1 gcal-J0603+174 36 - - <br />
1 gcal-J0603+174 37 - - <br />
1 gcal-J0603+174 38 - - <br />
1 gcal-J0603+174 39 - - <br />
1 gcal-J0603+174 40 - - <br />
1 gcal-J0603+174 41 - - <br />
1 gcal-J0603+174 42 - - <br />
1 gcal-J0603+174 43 - - <br />
1 gcal-J0603+174 44 - - <br />
1 gcal-J0603+174 45 - - <br />
1 gcal-J0603+174 46 - - <br />
1 gcal-J0603+174 47 - - <br />
1 gcal-J0603+174 48 - - <br />
1 gcal-J0603+174 49 - - <br />
1 gcal-J0603+174 50 - - <br />
1 gcal-J0603+174 51 - - <br />
1 gcal-J0603+174 52 - - <br />
1 gcal-J0603+174 53 - - <br />
1 gcal-J0603+174 54 - - <br />
1 gcal-J0603+174 55 - - <br />
1 gcal-J0603+174 56 - - <br />
1 gcal-J0603+174 57 - - <br />
1 gcal-J0603+174 58 - - <br />
1 gcal-J0603+174 59 - - <br />
1 gcal-J0603+174 60 - - <br />
1 gcal-J0603+174 61 - - <br />
1 gcal-J0603+174 62 - - <br />
1 gcal-J0603+174 63 - - <br />
2 G192.16-3.84 0 - - <br />
2 G192.16-3.84 1 - - <br />
2 G192.16-3.84 2 - - <br />
2 G192.16-3.84 3 - - <br />
2 G192.16-3.84 4 - - <br />
2 G192.16-3.84 5 - - <br />
2 G192.16-3.84 6 - - <br />
2 G192.16-3.84 7 - - <br />
2 G192.16-3.84 8 - - <br />
2 G192.16-3.84 9 - - <br />
2 G192.16-3.84 10 - - <br />
2 G192.16-3.84 11 - - <br />
2 G192.16-3.84 12 - - <br />
2 G192.16-3.84 13 - - <br />
2 G192.16-3.84 14 - - <br />
2 G192.16-3.84 15 - - <br />
2 G192.16-3.84 16 - - <br />
2 G192.16-3.84 17 - - <br />
2 G192.16-3.84 18 - - <br />
2 G192.16-3.84 19 - - <br />
2 G192.16-3.84 20 - - <br />
2 G192.16-3.84 21 - - <br />
2 G192.16-3.84 22 - - <br />
2 G192.16-3.84 23 - - <br />
2 G192.16-3.84 24 - - <br />
2 G192.16-3.84 25 - - <br />
2 G192.16-3.84 26 - - <br />
2 G192.16-3.84 27 - - <br />
2 G192.16-3.84 28 - - <br />
2 G192.16-3.84 29 - - <br />
2 G192.16-3.84 30 - - <br />
2 G192.16-3.84 31 - - <br />
2 G192.16-3.84 32 - - <br />
2 G192.16-3.84 33 - - <br />
2 G192.16-3.84 34 - - <br />
2 G192.16-3.84 35 - - <br />
2 G192.16-3.84 36 - - <br />
2 G192.16-3.84 37 - - <br />
2 G192.16-3.84 38 - - <br />
2 G192.16-3.84 39 - - <br />
2 G192.16-3.84 40 - - <br />
2 G192.16-3.84 41 - - <br />
2 G192.16-3.84 42 - - <br />
2 G192.16-3.84 43 - - <br />
2 G192.16-3.84 44 - - <br />
2 G192.16-3.84 45 - - <br />
2 G192.16-3.84 46 - - <br />
2 G192.16-3.84 47 - - <br />
2 G192.16-3.84 48 - - <br />
2 G192.16-3.84 49 - - <br />
2 G192.16-3.84 50 - - <br />
2 G192.16-3.84 51 - - <br />
2 G192.16-3.84 52 - - <br />
2 G192.16-3.84 53 - - <br />
2 G192.16-3.84 54 - - <br />
2 G192.16-3.84 55 - - <br />
2 G192.16-3.84 56 - - <br />
2 G192.16-3.84 57 - - <br />
2 G192.16-3.84 58 - - <br />
2 G192.16-3.84 59 - - <br />
2 G192.16-3.84 60 - - <br />
2 G192.16-3.84 61 - - <br />
2 G192.16-3.84 62 - - <br />
2 G192.16-3.84 63 - - <br />
3 3c84-J0319+413 0 - - <br />
3 3c84-J0319+413 1 - - <br />
3 3c84-J0319+413 2 - - <br />
3 3c84-J0319+413 3 - - <br />
3 3c84-J0319+413 4 - - <br />
3 3c84-J0319+413 5 - - <br />
3 3c84-J0319+413 6 - - <br />
3 3c84-J0319+413 7 - - <br />
3 3c84-J0319+413 8 - - <br />
3 3c84-J0319+413 9 - - <br />
3 3c84-J0319+413 10 - - <br />
3 3c84-J0319+413 11 - - <br />
3 3c84-J0319+413 12 - - <br />
3 3c84-J0319+413 13 - - <br />
3 3c84-J0319+413 14 - - <br />
3 3c84-J0319+413 15 - - <br />
3 3c84-J0319+413 16 - - <br />
3 3c84-J0319+413 17 - - <br />
3 3c84-J0319+413 18 - - <br />
3 3c84-J0319+413 19 - - <br />
3 3c84-J0319+413 20 - - <br />
3 3c84-J0319+413 21 - - <br />
3 3c84-J0319+413 22 - - <br />
3 3c84-J0319+413 23 - - <br />
3 3c84-J0319+413 24 - - <br />
3 3c84-J0319+413 25 - - <br />
3 3c84-J0319+413 26 - - <br />
3 3c84-J0319+413 27 - - <br />
3 3c84-J0319+413 28 - - <br />
3 3c84-J0319+413 29 - - <br />
3 3c84-J0319+413 30 - - <br />
3 3c84-J0319+413 31 - - <br />
3 3c84-J0319+413 32 - - <br />
3 3c84-J0319+413 33 - - <br />
3 3c84-J0319+413 34 - - <br />
3 3c84-J0319+413 35 - - <br />
3 3c84-J0319+413 36 - - <br />
3 3c84-J0319+413 37 - - <br />
3 3c84-J0319+413 38 - - <br />
3 3c84-J0319+413 39 - - <br />
3 3c84-J0319+413 40 - - <br />
3 3c84-J0319+413 41 - - <br />
3 3c84-J0319+413 42 - - <br />
3 3c84-J0319+413 43 - - <br />
3 3c84-J0319+413 44 - - <br />
3 3c84-J0319+413 45 - - <br />
3 3c84-J0319+413 46 - - <br />
3 3c84-J0319+413 47 - - <br />
3 3c84-J0319+413 48 - - <br />
3 3c84-J0319+413 49 - - <br />
3 3c84-J0319+413 50 - - <br />
3 3c84-J0319+413 51 - - <br />
3 3c84-J0319+413 52 - - <br />
3 3c84-J0319+413 53 - - <br />
3 3c84-J0319+413 54 - - <br />
3 3c84-J0319+413 55 - - <br />
3 3c84-J0319+413 56 - - <br />
3 3c84-J0319+413 57 - - <br />
3 3c84-J0319+413 58 - - <br />
3 3c84-J0319+413 59 - - <br />
3 3c84-J0319+413 60 - - <br />
3 3c84-J0319+413 61 - - <br />
3 3c84-J0319+413 62 - - <br />
3 3c84-J0319+413 63 - - <br />
Antennas: 26:<br />
ID Name Station Diam. Long. Lat. Offset from array center (m) ITRF Geocentric coordinates (m) <br />
East North Elevation x y z<br />
0 ea01 N48 25.0 m -107.37.38.1 +33.59.06.2 -855.2759 9405.9595 -25.9351 -1600374.885000 -5036704.201000 3562667.881900<br />
1 ea02 N56 25.0 m -107.37.47.9 +34.00.38.4 -1105.2071 12254.3069 -34.2426 -1600128.383400 -5035104.146500 3565024.672100<br />
2 ea03 N16 25.0 m -107.37.10.9 +33.54.48.0 -155.8511 1426.6436 -9.3827 -1601061.956000 -5041175.880700 3556058.037600<br />
3 ea05 W08 25.0 m -107.37.21.6 +33.53.53.0 -432.1184 -272.1472 -1.5070 -1601614.092200 -5042001.650900 3554652.508900<br />
4 ea06 N32 25.0 m -107.37.22.0 +33.56.33.6 -441.7237 4689.9748 -16.9332 -1600781.042100 -5039347.435200 3558761.533000<br />
5 ea07 E40 25.0 m -107.32.35.4 +33.52.16.9 6908.8279 -3240.7316 39.0057 -1595124.924100 -5045829.461500 3552210.685200<br />
6 ea09 E24 25.0 m -107.35.13.4 +33.53.18.1 2858.1754 -1349.1257 13.7290 -1598663.097500 -5043581.389700 3553767.027800<br />
7 ea10 E32 25.0 m -107.34.01.5 +33.52.50.3 4701.6588 -2209.7063 25.2191 -1597053.120700 -5044604.691600 3553059.009300<br />
8 ea11 W56 25.0 m -107.44.26.7 +33.49.54.6 -11333.2153 -7637.6824 15.3542 -1613255.404300 -5042613.085000 3548545.901400<br />
9 ea12 E08 25.0 m -107.36.48.9 +33.53.55.1 407.8285 -206.0065 -3.2272 -1600801.926000 -5042219.366500 3554706.448200<br />
10 ea13 W24 25.0 m -107.38.49.0 +33.53.04.0 -2673.3434 -1784.5870 10.4960 -1604008.742800 -5042135.827600 3553403.728800<br />
11 ea14 W16 25.0 m -107.37.57.4 +33.53.33.0 -1348.7083 -890.6269 1.3068 -1602592.853600 -5042055.005300 3554140.703900<br />
12 ea15 W72 25.0 m -107.48.24.0 +33.47.41.2 -17419.4730 -11760.2869 14.9578 -1619757.314900 -5042937.673700 3545120.385300<br />
13 ea16 N08 25.0 m -107.37.07.5 +33.54.15.8 -68.9252 433.1901 -5.0683 -1601147.956700 -5041733.824100 3555235.952500<br />
14 ea17 E48 25.0 m -107.30.56.1 +33.51.38.4 9456.5938 -4431.6366 37.9317 -1592894.088800 -5047229.121000 3551221.221100<br />
15 ea18 E72 25.0 m -107.24.42.3 +33.49.18.0 19041.8754 -8769.2059 4.7234 -1584460.867200 -5052385.599300 3547599.997600<br />
16 ea19 W64 25.0 m -107.46.20.1 +33.48.50.9 -14240.7600 -9606.2738 17.1055 -1616361.584300 -5042770.519200 3546911.442800<br />
17 ea20 N72 25.0 m -107.38.10.5 +34.04.12.2 -1685.6775 18861.8403 -43.4734 -1599557.932000 -5031396.371000 3570494.760600<br />
18 ea21 E64 25.0 m -107.27.00.1 +33.50.06.7 15507.6045 -7263.7280 67.1961 -1587600.190400 -5050575.873800 3548885.396600<br />
19 ea22 N24 25.0 m -107.37.16.1 +33.55.37.7 -290.3745 2961.8582 -12.2374 -1600930.087700 -5040316.398500 3557330.387000<br />
20 ea23 N64 25.0 m -107.37.58.7 +34.02.20.5 -1382.3750 15410.1463 -40.6373 -1599855.675100 -5033332.371000 3567636.622500<br />
21 ea24 W40 25.0 m -107.41.13.5 +33.51.43.1 -6377.9740 -4286.7919 8.2191 -1607962.456900 -5042338.214500 3551324.943600<br />
22 ea25 W48 25.0 m -107.42.44.3 +33.50.52.1 -8707.9407 -5861.7854 15.5265 -1610451.925400 -5042471.123100 3550021.056800<br />
23 ea26 W32 25.0 m -107.39.54.8 +33.52.27.2 -4359.4561 -2923.1223 11.7579 -1605808.647100 -5042230.071500 3552459.203400<br />
24 ea27 E16 25.0 m -107.36.09.8 +33.53.40.0 1410.0316 -673.4696 -0.7909 -1599926.110000 -5042772.967300 3554319.791200<br />
25 ea28 N40 25.0 m -107.37.29.5 +33.57.44.4 -633.6167 6878.5984 -20.7748 -1600592.764000 -5038121.352000 3560574.847300<br />
</pre><br />
<br />
This task displays a lot of information about the MS. We can see that the observation was performed with the EVLA over an integration time of 4557 seconds (1.3 hours). The number of data records (10,061,248) is approximately equal to the number of baselines (N_antenna * [N_antenna - 1] / 2) X the number of integrations (observing time / time-average binning) X the number of spectral windows. For this observation, this is roughly 325 baselines (26X25/2) X 760 integrations (4557s total/6s avg) X 64 spectral windows = 15,808,000. Note that this is high by ~50%; this is because the "total time" reported is simply (start time) - (end time) of the MS, which includes periods of slewing, flagged data, and scans that were excluded from the final MS. Extra exercise: examine the MS using {{browsetable}} to see what a data record looks like (equivalent to a row, as displayed by this task).<br />
<br />
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings. From the spectral window information, we can see that there are a total of 64 (0 through 63) spectral windows in this dataset, each with 128 channels, and that they are all at Ka-band (which spans 26.5 - 40.0 GHz). <br />
<br />
The field listing shows four sources: <br />
<br />
* 3C147 (Field ID 0), the flux calibration source;<br />
* J0603+174 (1), used for calibrating the complex gains; <br />
* G192.16-3.84 (2), the science target; and<br />
* 3c84 (3), used for calibrating the spectral bandpass.<br />
<br />
Note the rapid switching between G192 and J0603: this will help us accurately calculate and transfer the gain phase solutions for these high-frequency data. Note that the original MS also included reference pointing calibration scans at X-band, but since the pointing solutions were already applied during observing, we did not retain these scans (in the interest of limiting dataset size).<br />
<br />
== Flagging the MS ==<br />
<br />
[[Image:PlotG192_flagcmd_4.1.png|200px|thumb|right|online flags plotted from flagcmd]]<br />
<br />
The online flags, which are a record of known bad data produced by the VLA online system, were applied by the archive when it generated the MS. However, it's good to have a sense of what was deleted in this process. A record of the flags is stored in a table in the MS called <tt>FLAG_CMD</tt>. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of <tt>G192_6s.ms</tt>.)<br />
<br />
You can examine the commands stored in the <tt>FLAG_CMD</tt> table using {{flagcmd}}:<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='list', \<br />
useapplied=True)<br />
</source><br />
* <tt>useapplied=True</tt>: tells the task to list flags that have already been applied to the MS (which includes all online flags; otherwise, they would be ignored)<br />
<br />
The flag information will be printed to the terminal (all 2870 rows). The majority of the flags are "ANTENNA_NOT_ON_SOURCE" -- most of these were generated as a result of the slewing required for the fast switching between G192 and the phase calibrator.<br />
<br />
You can also plot the commands stored in the <tt>FLAG_CMD</tt> table:<br />
<source lang="python"><br />
# In CASA<br />
myrows = range(2868)<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', \<br />
useapplied=True, tablerows=myrows)<br />
</source><br />
<br />
Note that for demonstration purposes, we have chosen to only plot the first 2868 rows. The last two rows are from flagging zeros in the data (caused by correlator errors) and data which have been flagged due to [http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary#Shadowing_and_Cross-Talk antenna shadowing]. (Since the data were taken in the most widely spaced A-configuration, little if any data were likely affected by shadowing.) If you prefer you can omit the <tt>tablerows</tt> selection parameter and plot the last two rows as well -- you will just get lines at the bottom marked as "All" antennas for these flags.<br />
<br />
By default, this will bring up a <tt>matplotlib</tt> plotter. You can have it plot to a PNG file instead:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagcmd(vis='G192_6s.ms', inpmode='table', action='plot', tablerows=myrows, <br />
useapplied=True, plotfile='PlotG192_flagcmd_4.1.png')<br />
</source><br />
<br />
The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see the ANTENNA_NOT_ON_SOURCE flags between scans, some FOCUS_ERROR flags here and there, and the occasional SUBREFLECTOR_ERROR flag also between scans (most likely after the receiver band changes that are necessary for reference pointing; when the subreflectors rotate to pick up the new feed on the ring, some are slower than others). You want to be wary of long blocks of unexpected flags, which might be false alarms and cause you to flag too much data. In that case, look at the data itself in {{plotms}} (see below for examples) to decide whether or not to apply all flags. (Note: for the dataset in this tutorial, we have already deleted all the flagged data to reduce the file size, so you won't be able to inspect the flagged data within the MS. To do so, you will need to download the original dataset from the [https://archive.nrao.edu/archive/advquery.jsp NRAO Science Data Archive].)<br />
<br />
[[Image:plotG192_plotants.png|200px|thumb|right|plotants plotter]]<br />
To plot up the antenna positions in the array:<br />
<source lang="python"><br />
# In CASA<br />
plotants('G192_6s.ms')<br />
</source><br />
<br />
NOTE: if after this point (or any other) you get "table locks", which may occur erroneously and are sometimes triggered by plotting tasks, use {{clearstat}} to clear them:<br />
<br />
<source lang="python"><br />
# In CASA<br />
clearstat<br />
</source><br />
<br />
Now we examine the MS looking for bad data to flag. We will use {{plotms}} to bring up an interactive GUI that will display 2-D Y vs. X style line plots. <b>NOTE: We do not recommend using the editing/flagging features of {{plotms}}.</b> It is very easy to mess up your data this way. Also, to improve speed we will be restricting the scope of plotting, so most box/flag operations would not get rid of all the bad data -- although they would ''appear'' to delete it, which is misleading. <br />
<br />
We will instead use {{plotms}} to identify bad data and then use {{flagcmd}} to flag it. This will also allow full scripting of the flagging, which is ultimately the best way to keep track of what's been deleted. Given the large dataset sizes now being generated, reproducibility is extremely important. Imagine spending a day flagging your data, then a disk error corrupts the MS: it's imperative that you have an automated way to regenerate your work! This is also why we also encourage you to keep a running file with all the commands you use to process a dataset.<br />
<br />
NOTE: If you need an introduction to {{plotms}}, see:<br />
* [[Data flagging with plotms]]<br />
* [[Averaging data in plotms]]<br />
* [[What's the difference between Antenna1 and Antenna2? Axis definitions in plotms]]<br />
<br />
WARNING: The '''Flag''' [[Image:FlagThoseData.png]] button on the plotms GUI is close to other buttons you will be using, in particular the one that deletes boxes you have drawn [[Image:DeleteBox.png]]. Be careful you don't hit the '''Flag''' button by mistake!<br />
<br />
To get an idea of the data layout, plot a single baseline (ea02&ea05), channel (31, for all spectral windows), and polarization (RR) versus time. Note that limiting the selected data with appropriate filters is extremely helpful when plotting large datasets:<br />
[[Image:screenshotPlotG192_plotms_ant02-05_4.1.png|200px|thumb|right|plotms of ea02&ea05 amp vs time]]<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='', spw='*:31~31', \<br />
antenna='ea02&ea05', xaxis='time', yaxis='amp', \<br />
correlation='rr', coloraxis='field')<br />
</source><br />
<br />
Here, we can see the alternating phase calibration and science target scans, as well as the (brighter) bandpass calibrator at the end of the observation. Feel free to play with ways to view. For example, you can change the size of the plotted points, if they are too small to see easily, by setting "Unflagged Points Symbol" to "Custom" and increasing the number of pixels under "Style." You can also experiment with data averaging, plotting different correlations (if you're not doing polarization calibration, you can ignore the "cross-hand" correlations RL and LR and focus on "parallel-hand" correlations RR and LL), changing the plotted axes, altering the colorization scheme (try colorizing by baseline, correlation, field, etc.).<br />
<br />
[[Image:screenshotPlotG192_plotms_baseline_4.1.png|200px|thumb|right|plotms baseline amplitudes for field 3]]<br />
<br />
Look for bad antennas by picking the bandpass calibrator and plotting baselines. We color the points by "antenna1" to see which antennas might be troublesome:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', spw='*:31~31', \<br />
antenna='', xaxis='baseline',\<br />
yaxis='amp', coloraxis='antenna1')<br />
</source><br />
<br />
You should be able to see that three of the antennas have lower amplitudes than the rest. Boxing with the '''Mark Regions''' [[File:MarkRegionsButton.png]] tool and using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool will show in the logger that these are antennas ea01, ea10 and ea19; indeed, checking the [https://archive.nrao.edu/archive/ArchiveRouter?OBS_LOGS=EVLA,TVER0004,56295.000000,56296.000000 Operator Log] for this observation shows that these antennas have collimation offsets and that the data have been corrupted. We will delete these antennas.<br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea13.png|200px|thumb|right|plotms field 3 ea05 and ea13 amp vs frequency]]<br />
<br />
Now look at the raw spectral bandpasses of baselines to ea05. It is in the inner core of the array and a prospective reference antenna. Since we plan to flag them, we will exclude antennas ea01, ea10, and ea19 using negation (represented by "!") in the selection, and iterate by antenna:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea19', \<br />
xaxis='frequency', yaxis='amp', <br />
coloraxis='corr', iteraxis='antenna')<br />
</source><br />
<br />
As you iterate through baselines with ea05, you'll notice that the plot for ea05&ea13 shows that ea13's RCP (correlation = "RR") is weak, as noted in the log file as well. We will flag this antenna over all correlations, since current restrictions do not allow for single-polarization data to be imaged if it's part of a full-polarization dataset. <br />
<br />
Also, note that spectral windows 16 through 31 (the upper baseband) for antenna ea18 look very suspicious. We need to keep an eye on these data.<br />
<br />
For antenna ea24, there appear to be some issues with spectral windows 47 and 48, and the RCP of spw 40 also looks problematic, so we'll flag this as well. <br />
<br />
[[Image:plotG192_plotms_field3_ea05_ea18.png|200px|thumb|right|plotms field 3 ea05 and ea18 phase vs frequency]]<br />
<br />
Now plot the phases, iterating through baselines to ea05:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', \<br />
antenna='ea05;!ea01;!ea10;!ea13;!ea19', \<br />
xaxis='frequency', yaxis='phase', \<br />
coloraxis='spw', iteraxis='antenna')<br />
</source><br />
<br />
Notice the rapidly winding phases with frequency due to residual instrumental delays (we will calibrate the instrumental delays and smooth-out the phases later). Most span a turn or less over each 128-MHz subband, but there are some outliers. Step through to ea18. You will see that there are large jumps between spectral windows for spw 16-31 (see plot on the right). This reinforces our suspicion that something is wrong with these data on ea18 and we will flag them as well. <br />
<br />
To carry out the flagging, we again use {{flagcmd}} in the mode where it takes a list of command strings:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['antenna="ea01,ea10,ea19,ea13"',<br />
'antenna="ea24" spw="40,47~48"',<br />
'antenna="ea18" spw="16~31"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
These commands will carry out the flags and add a record of them to the FLAG_CMD table (where they will be marked as applied). Before applying the flags, a backup version of the flags will be stored as <tt>flagcmd_1</tt>, in case you would like to restore the MS to the state it was in prior to your new flags (this can be done using {{flagmanager}} with mode = "restore" and, in this case, versionname = "flagcmd_1").<br />
<br />
Plot the data again, now that is has been flagged (this time, we'll look at amplitude vs. frequency):<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='3', antenna='ea05', \<br />
xaxis='frequency', yaxis='amp')<br />
</source><br />
<br />
[[Image:plotG192_plotms_ea02fld3.png|200px|thumb|right|plotms field 3 ea05 amp vs frequency]]<br />
<br />
Now let's look at our phase calibrator -- it is weaker, and we can see some RFI:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_6s.ms', field='1', antenna='ea05', coloraxis = 'spw',\<br />
correlation = 'RR,LL', xaxis='frequency', yaxis='amp', scan='10,20,30,40,50,60')<br />
</source><br />
Note that we've chosen a subset of scans to limit the amount of data being plotted. This will give us a sense of whether there is serious RFI (or other issues) present in the data, but will obviously not display everything. Later on, when we plot the calibrated data, we will need to again inspect for possible bad data (and we will flag and recalibrate).<br />
<br />
Use the Zoom button [[File:ZoomButton.png]], Mark Regions [[File:MarkRegionsButton.png]], and Locate [[File:Casaplotms-locate-tool.png]] to identify the frequency/channels of the RFI. In particular, we note the following:<br />
* 27.228 GHz (spw 33 ch 124)<br />
* 27.707 GHz (spw 37 ch 91)<br />
* 27.81-27.811 GHz (spw 38 ch 66-67)<br />
* 27.819-27.821 GHz (spw 38 ch 75-77)<br />
* 28.894 GHz (spw 46 ch 126)<br />
* 28.976 GHz (spw 48 ch 0)<br />
* 29.684-20.685 GHz (spw 53 ch 68-69)<br />
* 30.976 GHz (spw 63 ch 80) very strong<br />
* 35.782 GHz (spw 10 ch 26)<br />
* 36.523 GHz (spw 15 ch 127)<br />
* 37.946 GHz (spw 27 ch 62)<br />
* 37.948 GHz (spw 27 ch 64)<br />
<br />
Flag these channels:<br />
<source lang="python"><br />
# In CASA<br />
flaglist = ['spw="33:124,37:91,38:66~67;75~77,46:126,48:0"', \<br />
'spw="53:68~69,63:80,10:26,15:127,27:62,27:64"']<br />
flagcmd(vis='G192_6s.ms', inpmode='list', inpfile=flaglist, \<br />
action='apply', flagbackup=True)<br />
</source><br />
When this is finished, it's useful to have a look at the flagged data. To reload the plotms window after taking the new flags into account, check the "force reload" box on the lower left of the plotms GUI and click on "Plot." (As a shortcut, you can also hold down the "Shift" key while clicking on the "Plot" button to force-reload a plot.)<br />
<br />
Finally, split off the good data, without retaining the flagged data. This will allow us to work on the data without having to start completely over (if we mess something up badly), as well as let us do simpler data selections (since the data size will be a bit smaller).<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Remove any existing split data, otherwise split will not happen<br />
os.system('rm -rf G192_flagged_6s.ms')<br />
split(vis='G192_6s.ms', outputvis='G192_flagged_6s.ms', \<br />
datacolumn='data', keepflags=False)<br />
</source><br />
* keepflags=False: again, to limit the size of the MS, we do not propagate flagged data to the split-off MS.<br />
<br />
You now have a MS called <tt>G192_flagged_6s.ms</tt> in your working area. This should be 16GB in size, which you can determine at the CASA command prompt by typing:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('du -sh G192_flagged_6s.ms')<br />
</source><br />
<br />
Note that the built-in <tt>system</tt> function allows one to execute UNIX shell commands within a CASA session. (Some, like <tt>ls</tt>, don't need this extra wrapper, but most are not automatically understood.)<br />
<br />
[[Image:PlotG192_plotms_datastream.png|200px|thumb|right|plotms antenna2 vs. time "datastream" plot]]<br />
At this point it is useful to plot a "datastream" view of the MS to show which antennas are present at different times. You can do this using:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', xaxis='time', yaxis='antenna2', \<br />
symbolshape = 'circle', plotrange=[-1,-1,0,26], coloraxis='field')<br />
</source><br />
This shows the times where data is present on baselines '''to''' a given antenna (controlled by setting yaxis="Antenna2"). Note that this means there is no "line" plotted for ea01 (antenna 0). You can pick-up ea01 (and drop ea28) by setting <tt>yaxis='antenna1'</tt>. To the right we show this plot. You can see that, for the most part, all antennas are present for the entire observation. One exception to this is antenna ea16, which comes in a little late on the first scan of G192.<br />
<br />
== Calibration ==<br />
<br />
Before proceeding with calibration, we will summarize the split flagged MS:<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_flagged_6s.ms', listfile='G192_flagged_listobs.txt')<br />
</source><br />
<br />
As before, inspection of the listobs output text file shows that there are now 6,958,621 data records present, and 22 antennas remaining in the MS.<br />
<br />
=== Setting the flux density scale ===<br />
<br />
It is now time to begin calibration! The general data reduction strategy is to derive a series of scaling factors or corrections from the calibrators, which, in addition to <i>a priori</i> calibration information, are collectively applied to the science target. For <em>much</em> more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see [http://casa.nrao.edu/docs/UserMan/UserManch4.html#x195-1920004 Synthesis Calibration] in the CASA Cookbook and User Reference Manual .<br />
<br />
The first step is to insert a model for our flux calibrator source (3C147) into the MS in order to set the flux density scale for bootstrapping to other sources. In order to do this, we first have to locate the model image on our system with {{setjy}}. The {{setjy}} task has an option to list available model images:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', listmodels=True)<br />
</source><br />
which sends output to your terminal (but not the logger). For example, on an NRAO workstation, we obtain the following:<br />
<pre><br />
No candidate modimages matching '*.im* *.mod*' found in .<br />
<br />
Candidate modimages (*) in /home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels:<br />
3C138_A.im 3C138_L.im 3C138_U.im 3C147_C.im 3C147_Q.im 3C147_X.im 3C286_K.im 3C286_S.im 3C48_A.im 3C48_L.im 3C48_U.im<br />
3C138_C.im 3C138_Q.im 3C138_X.im 3C147_K.im 3C147_S.im 3C286_A.im 3C286_L.im 3C286_U.im 3C48_C.im 3C48_Q.im 3C48_X.im<br />
3C138_K.im 3C138_S.im 3C147_A.im 3C147_L.im 3C147_U.im 3C286_C.im 3C286_Q.im 3C286_X.im 3C48_K.im 3C48_S.im README<br />
</pre><br />
<br />
The relevant image for our purposes is <tt>3C147_A.im</tt>, in the directory <tt>/home/casa/packages/RHEL5/prerelease/casapy-42.0.prerelease-10-1-64b/data/nrao/VLA/CalModels/</tt>. Your system may show a different location (for example <tt>/home/casa/data/nrao/VLA/CalModels/</tt>, or <tt>/Applications/CASA.app/Contents/data/nrao/VLA/CalModels</tt> on a Mac). Since CASA knows about this image, we only have to give the image name and not the entire path. Note that outside of the NRAO, you may need to provide setjy with the entire path along with the model image name (this depends on your platform and installation location). <br />
<br />
We can now run the {{setjy}} task using the appropriate model:<br />
<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
</source><br />
<br />
[[Image:screenshotPlotG192_setjy_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C147]]<br />
* <tt>scalebychan=True</tt>: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.<br />
* <tt>usescratch=False</tt>: put the model in the header instead of creating scratch columns in the MS. This will take up considerably less disk space.<br />
<br />
We can plot the model data using {{plotms}}:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', antenna='ea02&ea05', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
Inspecting the logger report shows that 3C147 has a flux density of 1.40608 Jy at the lower end of the band (spw 63; ~31 GHz) and 1.2779 Jy at the upper end (spw 0; ~35 GHz).<br />
<br />
=== Deriving <i>a priori</i> calibrations ===<br />
<br />
Some calibration products are carried along throughout the calibration process and used as priors for subsequent calibration steps. These include the antenna position corrections, gain-elevation curves, tropospheric opacity corrections, and requantizer gains.<br />
<br />
==== Antenna position corrections ====<br />
<br />
We use {{gencal}} to determine any antenna-position corrections that need to be applied to the data. This is based on a database of corrections with the dates and times the corrections were determined and when they were included in the online observing system.<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.antpos', \<br />
caltype='antpos', antenna='')<br />
</source><br />
You should see in the logger:<br />
<br />
<pre style="background-color: #fffacd;"><br />
Determine antenna position offests from the baseline correction database<br />
offsets for antenna ea05 : 0.00000 -0.00100 0.00090<br />
offsets for antenna ea16 : -0.00310 0.00000 0.00100<br />
</pre><br />
<br />
So this dataset does require antenna position corrections on ea05 & ea16. If no corrections were necessary, the output from gencal would have appeared as follows:<br />
<br />
<pre style="background-color: #fffacd;"><br />
No offsets found for this MS<br />
*** Warning *** No offsets found. No caltable created.<br />
gencal::::casa An error occurred running task gencal.<br />
</pre><br />
Although the "warning" makes it seem as if the task has failed, the message is normal and means there simply aren't any antenna corrections to apply.<br />
<br />
==== Gain-elevation curves ====<br />
<br />
We will use {{gencal}} to create calibration tables containing the gain curves and tropospheric opacity corrections for the antennas. Note that the <tt>gaincurve=True</tt> option that was previously available in calibration tasks (e.g., bandpass) is no longer available as of CASA 4.2. The syntax for generating a gaincurve calibration table in gencal is as follows:<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.gaincurve', \<br />
caltype='gc')<br />
</source><br />
<br />
==== Tropospheric opacity corrections ====<br />
<br />
[[Image:G192_plotWX.png|200px|thumb|right|plotweather output]]<br />
<br />
The atmospheric opacity during the observations can be computed from a seasonal model and/or weather station information. We will use the {{plotweather}} task to display the weather information and to calculate the zenith opacities for each spectral window. After the zenith opacities are derived, {{gencal}} will recompute the correct elevation of the data automatically using <math>e^{(-\csc[el]\tau_z)}</math> and create the opacity-correction calibration table. <br />
<br />
To start, we want to plot the opacity of the atmosphere at the time these observations was taken. {{plotweather}} plots the weather conditions during the observations and calculates the atmospheric opacities based on these data, in combination with a seasonal model that contains long-term statistics at the VLA site. Using <tt>seasonal_weight=0.5</tt> (the default value) gives equal weights to the seasonal model and weather station data: <br />
<br />
We will be running {{plotweather}} in a way that will assign the opacity list (one entry for each spectral window in ascending order) to the variable myTau:<br />
<br />
<source lang="python"><br />
# In CASA<br />
myTau = plotweather(vis='G192_flagged_6s.ms', doPlot=T)<br />
</source><br />
<br />
The logger should display:<br />
<pre style="background-color: #fffacd;"><br />
##########################################<br />
##### Begin Task: plotweather #####<br />
plotweather(vis="G192_flagged_6s.ms",seasonal_weight=0.5,doPlot=True,plotName="")<br />
2013-06-18 21:47:00 INFO plotweather SPW : Frequency (GHz) : Zenith opacity (nepers)<br />
0 : 34.476 : 0.03<br />
1 : 34.604 : 0.031<br />
2 : 34.732 : 0.031<br />
3 : 34.860 : 0.031<br />
4 : 34.988 : 0.032<br />
<snip><br />
61 : 30.640 : 0.024<br />
62 : 30.768 : 0.024<br />
63 : 30.896 : 0.024<br />
wrote weather figure: G192_flagged_6s.ms.plotweather.png<br />
##### End Task: plotweather #####<br />
##########################################<br />
</pre> <br />
<br />
In addition to assigning the myTau variable to the full list of opacities per spw, plotweather also creates a file <tt>G192_flagged_6s.ms.plotweather.png</tt> with the elevation of the sun, the wind speed and direction, the temperature, and precipitable water vapor (PWV) as functions of time over the course of the observation (view this file with your preferred image viewer like gthumb, xv, or Preview).<br />
<br />
We can now create a calibration table to correct for the atmospheric opacity with {{gencal}} using the <tt>calmode='opac'</tt> parameter. We could input the opacities directly, but it's easier to use the myTau variable with a little Python:<br />
<br />
<source lang="python"><br />
# In CASA<br />
SPWs = []<br />
for window in range(0,64):<br />
SPWs.append(str(window))<br />
</source><br />
<br />
<source lang="python"><br />
# In CASA<br />
spwString = ','.join(SPWs)<br />
gencal(vis='G192_flagged_6s.ms', caltable='calG192.opacity',<br />
caltype='opac', spw=spwString, parameter=myTau)<br />
</source><br />
<br />
==== Requantizer gain corrections ====<br />
<br />
Finally, we will use {{gencal}} to create a calibration table containing corrections for the requantizer gains. Although this is only necessary for 3-bit data, such as our G192 dataset, it can be done for 8-bit datasets without any ill effects. For 3-bit data, this step is needed to account for the small gain changes (~5-10%) that result from resetting the quantizer gains as the correlator changes to a new 3-bit configuration. (Here is [https://science.nrao.edu/facilities/vla/docs/manuals/obsguide/modes/set-up/3bit/#dp more information on observing with the 3-bit system].)<br />
<source lang="python"><br />
# In CASA<br />
gencal('G192_flagged_6s.ms', caltable='calG192.requantizer', \<br />
caltype='rq')<br />
</source><br />
<br />
The caltables we have generated (<tt>calG192.antpos</tt>, <tt>calG192.gaincurve</tt>, <tt>calG192.opacity</tt>, and <tt>calG192.requantizer</tt>) will need to be pre-applied in subsequent calibration steps.<br />
<br />
=== Calibrating delays and initial bandpass solutions ===<br />
<br />
[[Image:plotG192_plotcal_G0p1_4.0.png|200px|thumb|right|plotcal G0 phase ant 0~15]]<br />
[[Image:plotG192_plotcal_G0p2_4.0.png|200px|thumb|right|plotcal G0 phase ant 16~26]]<br />
<br />
[[Image:plotG192_plotcal_delays.png|200px|thumb|right|plotcal K0 delay vs. antenna]]<br />
<br />
[[Image:plotG192_plotcal_B0a1_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2_4.0.png|200px|thumb|right|plotcal B0 bandpass amp ant ea06 spw 32-63]]<br />
<br />
First, we do a phase-only calibration solution on a narrow range of channels near the center of each spectral window on the bandpass calibrator 3C84 to flatten them with respect to time before solving for the bandpass. The range 60~68 should work. Pick a reference antenna near the center of the array -- ea05 is a reasonable choice (see above):<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos','calG192.gaincurve', \<br />
'calG192.requantizer','calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3)<br />
<br />
</source><br />
<br />
* <tt>refant='ea05'</tt> : Use ea05 as the reference antenna<br />
* <tt>solint='int'</tt> : Do a per-integration solve (every 6 seconds, since we've time-averaged the data).<br />
* <tt>minsnr=3</tt> : Apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.<br />
* <tt>gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', 'calG192.opacity']</tt> : Pre-apply the antenna position corrections, gaincurve, opacity, and requantizer calibration tables.<br />
<br />
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Step through the antenna-based solutions. They look good (and fairly flat over the scans).<br />
<br />
NOTE: When you are done plotting and want to use the calibration table in another task (e.g., for subsequent calibration or viewing with plotms), use the Quit button on the GUI to dismiss the plotter and free-up the lock on the calibration table. You should see a message in your terminal window saying "Resetting plotcal" which means you are good to go!<br />
<br />
If you want to make single-page, multipanel plots (like those shown to the right), particularly for a hardcopy (where it only shows the first page), you can do:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='0~10,12~15', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p1.png')<br />
plotcal(caltable='calG192.G0', xaxis='time', yaxis='phase', \<br />
antenna='16~26', subplot=531, iteration='antenna', \<br />
plotrange=[-1,-1,-180,180], fontsize=8.0, \<br />
markersize=3.0, figfile='plotG192_plotcal_G0p2.png')<br />
</source><br />
<br />
We can now solve for the residual delays that we saw in plotms when we plotted phase vs. frequency. This uses the <tt>gaintype='K'</tt> option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays, but instead does a baseline-based delay solution for all baselines to the reference antenna, treating these as antenna-based delays. In most cases with high-enough S/N to get baseline-based delay solutions, this will suffice. We avoid the edge channels of each spectral window by selecting channels 5~122:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
</source><br />
<br />
Note that we have also pre-applied our initial phase table, calG192.G0. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each spw and polarization):<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.K0', xaxis='antenna', yaxis='delay')<br />
</source><br />
<br />
The delays range from around -5 to 4 nanoseconds.<br />
<br />
Now we solve for the antenna bandpasses using the previous tables:<br />
<source lang="python"><br />
# In CASA<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0', 'calG192.K0'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
'''WARNING''': You must set <tt>solnorm=False</tt> here or later on you will find some offsets<br />
among spws due to the way the amplitude scaling adjusts weights internally during solving.<br />
<br />
[[Image:plotG192_plotcal_B0p1_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2_4.0.png|200px|thumb|right|plotcal B0 bandpass phase ant ea06 spw 32-63]]<br />
<br />
You will see in the terminal some reports of solutions failing due to "Insufficient unflagged antennas" -- note that these are for the channels we flagged earlier.<br />
<br />
This is the first amplitude-scaling calibration that we do, so it is important to have used the <tt>calG192.gaincurve</tt> caltable (or set <tt>gaincurve=True</tt>) as well as the <tt>calG192.opacity</tt> caltable (or set <tt>opacity</tt> appropriately).<br />
<br />
Plot the resulting bandpasses in amplitude and phase:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
In the bandpass phases you no longer see the residual antenna delays (just residual spw phase offsets from the delay solution registration), but there are some band edge effects apparent.<br />
<br />
=== Bootstrapping the bandpass calibrator spectrum ===<br />
<br />
Unfortunately, our flux density calibrator was not bright enough at Ka-band to use as the bandpass calibration source. Since there is no <i>a priori</i> spectral information for our chosen bandpass calibrator, 3C84, we need to bootstrap to find its spectral index, then recalibrate with this information in order to avoid folding the intrinsic spectral shape of 3C84 into our calibration.<br />
<br />
First, we use the initial round of bandpass calibration to create gain solutions for the flux and bandpass calibrators:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1', field='0,3', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0', \<br />
'calG192.B0'], \<br />
gaintype='G', refant='ea05', calmode='ap', solint='30s', minsnr=3)<br />
</source><br />
<br />
Now let's have a look at the phase and amplitude solutions, iterating over antenna. We will look at the flux calibrator (3C147) and bandpass calibrator (3C84) individually since they're widely separated in time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='0', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='amp', \<br />
field='3', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='0')<br />
#<br />
plotcal(caltable='calG192.G1', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180], \<br />
field='3')<br />
</source><br />
<br />
The solutions all look reasonable and relatively constant with time. <br />
<br />
Now that we have gain solutions for the flux and bandpass calibrators, we can use {{fluxscale}} to scale the gain amplitudes of the bandpass calibrator:<br />
<source lang="python"><br />
# In CASA<br />
flux1 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G1', \<br />
fluxtable='calG192.F1', reference='0', \<br />
transfer='3', listfile='3C84.fluxinfo', fitorder=1)<br />
</source><br />
* <tt>flux1 = fluxscale(...)</tt>: by providing a variable <tt>flux1</tt>, we allow {{fluxscale}} to use this for the output Python dictionary it returns with lots of information about the flux scaling. You can inspect the output dictionary flux1 by typing "print flux1" at the CASA command line.<br />
* <tt>fluxtable='calG192.F1'</tt>: this is the output scaled gain table. Since we are only using this to find the spectral index of 3C84, we won't be using this table.<br />
* <tt>listfile='3C84.fluxinfo'</tt>: an output file that contains the derived flux values and fit information.<br />
* <tt>fitorder=1</tt>: only find a spectral index, ignoring curvature in the spectrum.<br />
<br />
The last line in the file (and displayed in the logger) shows:<br />
<pre style="background-color: #fffacd;"><br />
# Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 29.8756 +/- 0.0381051 (freq=32.4488 GHz) spidx=-0.598926 +/- 0.0105203<br />
</pre><br />
<br />
[[Image:screenshotPlotG192_setjy_bp_4.1.png|200px|thumb|right|plotms of model amp vs freq for 3C84]]<br />
[[Image:plotG192_3C84_fluxspec_4.2.png|200px|thumb|right|3C84 flux values returned by fluxscale]]<br />
<br />
Using the information in the returned <tt>flux</tt> dictionary, we can plot the derived spectrum:<br />
<source lang="python"><br />
# In CASA<br />
freq = flux1['freq'] / 1e9<br />
spw_list = range(0,64)<br />
spw_str = []<br />
for i in spw_list:<br />
thisspw = str(i)<br />
spw_str.append(thisspw)<br />
<br />
bootstrapped_fluxes = []<br />
for j in spw_str:<br />
thisflux = a[j]['fluxd'][0]<br />
bootstrapped_fluxes.append(thisflux)<br />
<br />
pl.clf()<br />
pl.plot(freq, bootstrapped_fluxes, 'bo')<br />
pl.xlabel('Frequency (GHz)')<br />
pl.ylabel('Flux Density (Jy)')<br />
pl.title('3C84')<br />
pl.show()<br />
</source><br />
<br />
Note the bump around 37 GHz -- what is this? We will not be able to account for it with the simple spectral index model, but still, ours is a good first approximation.<br />
<br />
We can use the model from {{fluxscale}} to fill the MODEL column with 3C84's spectral information using {{setjy}}:<br />
<source lang="python"><br />
# In CASA<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
</source><br />
<br />
Checking with plotms that the data have been appropriately filled:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', antenna='ea05&ea02', \<br />
xaxis='freq', yaxis='amp', ydatacolumn='model')<br />
</source><br />
<br />
[[Image:plotG192_plotcal_B0a1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0a2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass amp ant ea06 spw 32-63]]<br />
[[Image:plotG192_plotcal_B0p1.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 0-31]]<br />
[[Image:plotG192_plotcal_B0p2.b_4.1.png|200px|thumb|right|plotcal B0 bootstrapped bandpass phase ant ea06 spw 32-63]] <br />
<br />
Finally, we redo the previous calibration using this new model information. Although the commands are the same as what we issued earlier, keep in mind that the model values for the bandpass calibrator have changed, and therefore the results of these calibration calculations will differ:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b', \<br />
field='3', spw='*:60~68', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', \<br />
solint='int', minsnr=3) <br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b'], \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
refant='ea05', solint='inf', minsnr=3)<br />
#<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.G0.b', 'calG192.K0.b'], \<br />
field='3', refant='ea05', solnorm=False, \<br />
bandtype='B', solint='inf')<br />
</source><br />
<br />
It's a good idea to inspect these solutions as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='0~31', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='amp', \<br />
spw='32~63', iteration='antenna')<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='0~31', \<br />
plotrange=[-1,-1,-180,180])<br />
#<br />
plotcal(caltable='calG192.B0.b', xaxis='freq', yaxis='phase', \<br />
iteration='antenna', spw='32~63', \<br />
plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
They look virtually unchanged from the previous solutions, with the exception that the amplitude scaling is corrected for the spectrum of 3C84. Now that we have the final version of our bandpass calibration, we can proceed to the full calibration of the dataset.<br />
<br />
=== Final phase and amplitude calibration ===<br />
<br />
[[Image:plotG192_plotcal_G1.int_4.1.png|200px|thumb|right|plotcal G1.int per-int phase ea06]]<br />
<br />
[[Image:plotG192_plotcal_G1.inf_4.1.png|200px|thumb|right|plotcal G1.inf per-scan phase ea06]]<br />
<br />
Now we will compute the calibrators' gain phases using the full bandwidth. We will do the calibrators one at a time and append subsequent solutions, since we will use different solution intervals. For 3C147 and 3C84, we obtain one solution per integration (these are bright enough); for the phase calibrator, J0603+174, we will use 12 second solution intervals:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p')<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
</source><br />
These will get applied when solving for amplitudes (see the "G2" calibration tables below), and when calibrating the calibrators themselves (with the task {{applycal}}).<br />
<br />
The phases track nicely with time:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.int', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
To apply phase calibration to the target, we will make a second table for the gain calibrator (J0603+174) with one solution per scan:<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='p')<br />
</source><br />
<br />
These phase gain solutions in calG192.G1.inf will be interpolated by {{applycal}} onto our target. These look good as well:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G1.inf', xaxis='time', yaxis='phase', \<br />
iteration='antenna', plotrange=[-1,-1,-180,180])<br />
</source><br />
<br />
Now, let's solve for amplitudes on a per-scan interval, after applying the per-integration phases. Do these separately using <tt>gainfield</tt> so phases don't get transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default. This is generally fine; we will set the interpolation to "nearest" (in time).<br />
<source lang="python"><br />
# In CASA<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='0', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='1', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', 'calG192.G1.int'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
field='3', refant='ea05', solnorm=F, \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
#<br />
</source><br />
<br />
[[Image:plotG192_plotcal_G2.inf_4.1.png|200px|thumb|right|plotcal G2 per-scan amp ant ea06]]<br />
<br />
Let's have a look at the amplitudes:<br />
<source lang="python"><br />
# In CASA<br />
plotcal(caltable='calG192.G2', xaxis='time', yaxis='amp', \<br />
iteration='antenna')<br />
</source><br />
<br />
We will apply this table (calG192.G2) to the data.<br />
<br />
First, we need to use {{fluxscale}} to transfer the amplitude solutions from 3C147:<br />
<source lang="python"><br />
# In CASA<br />
flux2 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2', \<br />
fluxtable='calG192.F2', reference='0')<br />
</source><br />
where we have now captured the return dictionary in the Python object <tt>flux2</tt>. <br />
<br />
The logger output gives:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252043 +/- 0.00779693 (SNR = 32.3259, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250608 +/- 0.00785259 (SNR = 31.9141, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783195 (SNR = 31.9395, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249326 +/- 0.00870076 (SNR = 28.6556, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.24779 +/- 0.00860759 (SNR = 28.7873, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280642 +/- 0.00884987 (SNR = 31.7115, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279742 +/- 0.00874457 (SNR = 31.9904, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.278071 +/- 0.00910153 (SNR = 30.5521, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277588 +/- 0.00955455 (SNR = 29.0529, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316725 (SNR = 31.9333, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326974 (SNR = 30.4248, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314246 (SNR = 31.9729, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.0042 +/- 0.0325531 (SNR = 30.8479, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243617 (SNR = 41.1434, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00589 +/- 0.0248197 (SNR = 40.5277, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01762 +/- 0.0240088 (SNR = 42.3855, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01145 +/- 0.0249814 (SNR = 40.488, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264382 +/- 0.000149793 (freq=32.4488 GHz) spidx=-0.834342 +/- 0.00458913<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00101 +/- 0.00121263 (freq=32.4488 GHz) spidx=0.00866148 +/- 0.0100409<br />
Storing result in calG192.F2<br />
Writing solutions to table: calG192.F2<br />
</pre><br />
You may see slightly different numbers on your machine. Note that "N" here is the number of antennas x the number of polarizations used for the calculations. In this case, there are 22 unflagged antennas and 2 polarizations.<br />
<br />
Also, note that the flux-scaled amplitudes for 3C84 are all almost exactly 1 Jy. This is not because the actual flux of 3C84 is 1 Jy, of course. Rather, remember that the spectrum and flux information is now included in the bandpass table. When we apply the calibration, in the next section, you will see that 3C84's flux does indeed come out as expected.<br />
<br />
== Applying the Calibration and Final Editing ==<br />
<br />
Next we apply all our accumulated calibration tables to the flagged MS. We apply these to the calibration fields individually, using the appropriate gainfields and interpolation for each:<br />
* For 3C147 (field 0) we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation, respectively;<br />
* for the nearby gain calibrator (field 1) we did 12-s phase and per-scan amplitude solutions, for which we will use "linear" and "nearest" interpolation, respectively;<br />
* for G192 (field 2), we will calibrate with field 1, using the per-scan solutions and "linear" interpolation; and finally,<br />
* for the bandpass calibrator 3C84 (field 3), we did per-integration phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.<br />
<br />
[[Image:plotG192_plotms_applied_fld0.png|200px|thumb|right|3C147 with calibration applied]]<br />
[[Image:plotG192_plotms_fld0_bybaseline.png|200px|thumb|right|3C147 with calibration applied, amp vs. baseline]]<br />
<source lang="python"><br />
# In CASA<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.G2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b',\<br />
'calG192.G1.inf', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
#<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b', 'calG192.B0.b', \<br />
'calG192.G1.int', 'calG192.F2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'],<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
Because we used <tt>usesratch=False</tt> in {{setjy}}, the <tt>CORRECTED_DATA</tt> scratch column will be created the first time you run {{applycal}}. This will take a few minutes to write, increasing the size of the MS to 30 GB, and will store the calibrated data in the calibrated data column of the MS.<br />
<br />
<br />
<pre style="background-color: #98FB98;"><br />
IMPORTANT NOTES ON THE USE OF YOUR FLUXSCALE (F2) TABLE IN APPLYCAL:<br />
<br />
* When we ran fluxscale and generated table calG192.F2 to transfer the amplitude solutions <br />
from our flux calibrator, fluxscale was run with incremental = False by default. This <br />
means that the flux density scale correction factors derived from the primary flux calibrator <br />
were applied to the gains of the secondary calibrators. So, the information from calG192.G2 <br />
(which contains the amplitude solutions) is already accounted for in calG192.F2 and we will <br />
NOT need to supply calG192.G2 to our list of calibration tables for our secondary <br />
calibrators and science target fields (in this case, fields 1, 2, and 3 -- we do still need <br />
our G2 table for field 0 though!).<br />
<br />
* It is also possible to run fluxscale with incremental = True. In this case, only the <br />
scale correction factors are written out to the fluxtable, and calG192.G2 would need to be <br />
included in the list of gaintables for ALL fields at the applycal stage.<br />
<br />
</pre> <br />
<br />
<br />
Now we examine the corrected data for 3C147. We will avoid spectral window edges and bin the data in time and frequency:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
In this plot (see figure above, right) there is some suspicious data in the frequency range of 38.15-38.26 GHz (spw 29). We can plot around this frequency range with respect to time to see if it's isolated RFI or something we should flag from the whole dataset:<br />
<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='time', yaxis='amp', \<br />
ydatacolumn='corrected', spw='29:5~122', \<br />
averagedata=True, avgchannel='16', \<br />
avgtime='', coloraxis='baseline')<br />
</source><br />
<br />
Indeed, something looks wrong for the time interval 6:35:00-6:36:40 for this spectral window. Flag these data:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', field='0', \<br />
spw='29', timerange='6:35:00~6:36:40')<br />
</source><br />
<br />
It's also instructive to plot the corrected amplitude as a function of baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good now!<br />
<br />
Next, we examine the corrected data for the gain calibrator, J0603+174, again avoiding spectral window edges where we know the data will be noisy. This time, we will bin the data even more in frequency, since the source is fainter:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
</source><br />
<br />
This generally looks quite good. Plot with respect to baseline as well:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
</source><br />
A few antennas look a little noisier, but nothing bad enough to flag for now.<br />
<br />
Finally, we examine the corrected data for 3C84:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='frequency', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
In general, it looks good, though there is one rather suspicious baseline dropping below the rest of the data. Box a few data points and use the "Locate" button to find that this is ea03&ea07. Plotting the same baseline for 3C147, we see that it doesn't look the best there either, so we will flag this baseline:<br />
<br />
<source lang="python"><br />
# In CASA<br />
flagdata(vis='G192_flagged_6s.ms', antenna='ea03&ea07')<br />
</source><br />
<br />
Now, let's plot amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
Looks good!<br />
<br />
* In theory, the calibrated data should yield, in a simple case of a point source in the center of the field, a physical source visibility amplitude (the source flux density) and zero phase. Although in practice we never achieve such "perfection," it is very useful to gauge the "quality" of your calibrated data by plotting either amplitude vs. phase or real vs. imaginary in plotms for your calibrators. This type of plot is intended as a diagnostic for calibrators only - unless your science targets are extremely bright, compact, and located directly at the phase center of the field, this type of plot will appear quite noisy and be of little use. Note that you can plot the corrected data column (as shown below), or the corrected-model column (this will tend to reduce the scatter in the plots and remove the effects of any structure in the model itself). Let's take a look:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
For well-calibrated data, we expect a fairly small amount of scatter and compact distribution of the data. (Note: if you see arc or doughnut-like shapes in your dataset, try selecting the corrected-model column instead.) Although we can see in the figures below that our calibration was not perfect, there is less than 2 degrees of phase scatter, and a plot of amplitude vs. frequency shows that this is mostly in the highest frequencies. We will keep all of these data.<br />
<br />
== Recalibration ==<br />
<br />
Since we flagged additional data, we will now go back and recalibrate:<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Clear the corrected data and model from header<br />
clearcal('G192_flagged_6s.ms', addmodel=False)<br />
<br />
# Insert the flux density model for 3C147 into the MS<br />
setjy(vis='G192_flagged_6s.ms', field='0', scalebychan=True, \<br />
model='3C147_A.im')<br />
<br />
# Fill the MODEL column with 3C84's spectral information<br />
setjy(vis='G192_flagged_6s.ms', field='3', scalebychan=True, \<br />
fluxdensity=[29.8756, 0, 0, 0], spix=-0.598929, \<br />
reffreq='32.4488GHz')<br />
<br />
# Initial Phase Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G0.b.2', field='3', spw='*:60~68',\<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity'], \<br />
gaintype='G', refant='ea05', calmode='p', solint='int', minsnr=3) <br />
<br />
# Delay Calibration<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.K0.b.2', \<br />
field='3', spw='*:5~122', gaintype='K', \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', \<br />
'calG192.requantizer', 'calG192.opacity','calG192.G0.b.2'], \<br />
refant='ea05', solint='inf', minsnr=3)<br />
<br />
# Bandpass Calibration<br />
bandpass(vis='G192_flagged_6s.ms', caltable='calG192.B0.b.2', \<br />
field='3', refant='ea05', solnorm=False, \<br />
gaintable=['calG192.antpos', 'calG192.gaincurve', 'calG192.requantizer',\<br />
'calG192.opacity','calG192.G0.b.2', 'calG192.K0.b.2'], \<br />
bandtype='B', solint='inf')<br />
<br />
# Phase Gain Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p')<br />
<br />
# Phase Gain Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='12s', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.int.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='int', gaintype='G', calmode='p', append=True)<br />
<br />
# Phase Gain Calibration Solutions - Field 1 - infinite solution interval <br />
# (Note: we will apply this table to our science target at the applycal stage.)<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G1.inf.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer','calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2','calG192.B0.b.2'], \<br />
solint='inf', gaintype='G', calmode='p')<br />
<br />
# Amplitude Calibration Solutions - Field 0<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='0', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a')<br />
<br />
# Amplitude Calibration Solutions - Field 1<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='1', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Amplitude Calibration Solutions - Field 3<br />
gaincal(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
field='3', refant='ea05', solnorm=F, \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', \<br />
'calG192.opacity', 'calG192.K0.b.2', \<br />
'calG192.B0.b.2', 'calG192.G1.int.2'], \<br />
gainfield=['', '', '', '', '3', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'nearest'], \<br />
solint='inf', gaintype='G', calmode='a', append=True)<br />
<br />
# Flux Scale Calibration Table (to apply to secondary calibrators)<br />
flux3 = fluxscale(vis='G192_flagged_6s.ms', caltable='calG192.G2.2', \<br />
fluxtable='calG192.F2.2', reference='0')<br />
<br />
# Apply Calibration Tables to Field 0 (Flux Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='0', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.G2.2'], \<br />
gainfield=['', '', '', '', '', '', '0', '0'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 1 (Phase Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='1', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 2 (Science Target)<br />
applycal(vis='G192_flagged_6s.ms', field='2', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.inf.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '1', '1'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'linear'], calwt=False)<br />
<br />
# Apply Calibration Tables to Field 3 (Bandpass Calibrator)<br />
applycal(vis='G192_flagged_6s.ms', field='3', \<br />
gaintable=['calG192.antpos', 'calG192.requantizer', 'calG192.gaincurve', 'calG192.opacity',\<br />
'calG192.K0.b.2', 'calG192.B0.b.2', 'calG192.G1.int.2', 'calG192.F2.2'], \<br />
gainfield=['', '', '', '', '', '', '3', '3'], \<br />
interp=['', '', '', '', 'nearest', 'nearest', 'linear', 'nearest'], calwt=False)<br />
</source><br />
<br />
The recalibration will take a little while -- it was over 1.5 hours on our system -- so this is a good time to work on a different project or grab some lunch!<br />
<br />
The {{fluxscale}} output this time around is slightly different:<br />
<pre><br />
Found reference field(s): 3C147<br />
Found transfer field(s): gcal-J0603+174 3c84-J0319+413<br />
Flux density for gcal-J0603+174 in SpW=0 is: 0.252049 +/- 0.00779748 (SNR = 32.3244, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=1 is: 0.250619 +/- 0.00784916 (SNR = 31.9294, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=2 is: 0.250149 +/- 0.00783732 (SNR = 31.9177, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=3 is: 0.249327 +/- 0.00869472 (SNR = 28.6757, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=4 is: 0.247794 +/- 0.00861206 (SNR = 28.7729, N = 44)<br />
<snip><br />
Flux density for gcal-J0603+174 in SpW=60 is: 0.280654 +/- 0.00883115 (SNR = 31.78, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=61 is: 0.279748 +/- 0.00876293 (SNR = 31.924, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=62 is: 0.27807 +/- 0.00912204 (SNR = 30.4833, N = 44)<br />
Flux density for gcal-J0603+174 in SpW=63 is: 0.277579 +/- 0.00954328 (SNR = 29.0863, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=0 is: 1.01141 +/- 0.0316702 (SNR = 31.9356, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=1 is: 0.994812 +/- 0.0326958 (SNR = 30.4262, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=2 is: 1.00473 +/- 0.0314171 (SNR = 31.9805, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=3 is: 1.00419 +/- 0.0325563 (SNR = 30.8449, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=4 is: 1.00361 +/- 0.0333546 (SNR = 30.0893, N = 44)<br />
<snip><br />
Flux density for 3c84-J0319+413 in SpW=60 is: 1.00232 +/- 0.0243542 (SNR = 41.156, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=61 is: 1.00588 +/- 0.0248152 (SNR = 40.5347, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=62 is: 1.01771 +/- 0.0239908 (SNR = 42.4207, N = 44)<br />
Flux density for 3c84-J0319+413 in SpW=63 is: 1.01143 +/- 0.0249739 (SNR = 40.4996, N = 44)<br />
Fitted spectrum for gcal-J0603+174 with fitorder=1: Flux density = 0.264388 +/- 0.000149708 (freq=32.4488 GHz) spidx=-0.834284 +/- 0.00458657<br />
Fitted spectrum for 3c84-J0319+413 with fitorder=1: Flux density = 1.00109 +/- 0.00122518 (freq=32.4488 GHz) spidx=0.00940404 +/- 0.010148<br />
</pre><br />
<br />
[[Image:plotG192_plotms_fld0_phaseamp.png|200px|thumb|right|3C147 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld1_phaseamp.png|200px|thumb|right|J0603+174 with calibration applied, amp vs. phase]]<br />
[[Image:plotG192_plotms_fld3_phaseamp.png|200px|thumb|right|3C84 with calibration applied, amp vs. phase]]<br />
<br />
As always, it's a good idea to check the corrected data with {{plotms}}. Plots of corrected amplitude vs. baseline:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='antenna1')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='baseline', yaxis='amp', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='antenna1')<br />
</source><br />
<br />
And, finally, corrected amplitude vs. corrected phase:<br />
<source lang="python"><br />
# In CASA<br />
plotms(vis='G192_flagged_6s.ms', field='0', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='1', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='32', \<br />
avgtime='6000s', coloraxis='baseline')<br />
#<br />
plotms(vis='G192_flagged_6s.ms', field='3', \<br />
xaxis='phase', yaxis='amp', \<br />
xdatacolumn='corrected', \<br />
ydatacolumn='corrected', spw='*:5~122', \<br />
averagedata=True, avgchannel='8', \<br />
avgtime='1000s', coloraxis='baseline')<br />
</source><br />
<br />
Everything looks good, and the recalibration made only minor adjustments since there wasn't very much additional flagged data. <br />
<br />
Now, split off the data for the calibrators and target field into separate MSs, so we can restore easily our calibrated dataset in case issues with data corruption arise. Before running split each time, we will remove any existing split data with the same name. Split will not automatically overwrite an existing MS. The inputs are:<br />
<br />
<source lang="python"><br />
# In CASA<br />
os.system('rm -rf 3C147_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C147_split_6s.ms', \<br />
datacolumn='corrected', field='0')<br />
#<br />
os.system('rm -rf J0603_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='J0603_split_6s.ms', \<br />
datacolumn='corrected', field='1')<br />
#<br />
os.system('rm -rf G192_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='G192_split_6s.ms', \<br />
datacolumn='corrected', field='2')<br />
#<br />
os.system('rm -rf 3C84_split_6s.ms')<br />
split(vis='G192_flagged_6s.ms', outputvis='3C84_split_6s.ms', \<br />
datacolumn='corrected', field='3')<br />
</source><br />
<br />
We can now move on to imaging!<br />
<br />
== Imaging ==<br />
<br />
The G192 data were taken in the VLA's highest-resolution A-configuration at Ka-band. To determine the best parameters for imaging, it helps to start with the relevant information in the [https://science.nrao.edu/facilities/vla/oss/oss Observational Status Summary]:<br />
<br />
* The synthesized beam is expected to be ~0.059" at 33 GHz with a primary beam field-of-view of 1.4 arcmin (82").<br />
<br />
Our data spans 27.0-38.4 GHz: this is a relatively very large fractional bandwidth (about 35%), resulting in substantial variation of the field of view over the entire frequency range. The FOV = 45 arcmin / Frequency (GHz), giving 1.7 arcmin at 27 GHz and 1.2 arcmin at 38.4 GHz. Likewise, the synthesized beam ranges from 0.072" at 27 GHz to 0.051" at 38.4 GHz. We want to subsample the synthesized beam by a factor of 3-5, so we will use a cellsize of 0.015". To cover the full FOV, we would want a minimum image size of 6800 pixels. However, there isn't much outside the center of the field for G192 -- this is what gave us leeway to average to 6 seconds -- so, to save time, we will only image a 1280x1280 pixel field (19.2"x19.2").<br />
<br />
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting. Briggs weighting will produce an image with a reasonable resolution, but will allow us to still see larger scale structure. Noise from sidelobes will also be reduced compared to Natural weighting.<br />
<br />
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes, <tt>imsize</tt> should be an even number with prime factors chosen from 2, 3, 5, and 7. Since 1280 = (2^8)*5, it will give us optimal clean performance. Note that {{clean}} will still run if imsize does not have prime factors 2, 3, 5, or 7 (it will just be a bit slower) but you should always choose an even number.<br />
<br />
For more information on using {{clean}}, in particular on using the interactive GUI, see [[EVLA_Continuum_Tutorial_3C391#Imaging]]. <br />
<br />
NOTE: If you are pressed for time, then you might want to jump ahead to<br />
[http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Cleaning_both_basebands_using_two_MFS_Taylor_terms cleaning both basebands], and while it is cleaning you can read the other Imaging descriptions.<br />
<br />
=== Cleaning a single spectral window ===<br />
<br />
Let us start by interactively cleaning one spectral window in the lower-frequency baseband (spw 48). (For Ka-band, the higher-numbered spectral-window baseband is actually the lower-frequency baseband.) <br />
<br />
'''Note that interrupting {{clean}} by Ctrl+C may corrupt your visibilities -- you may be better off choosing to let {{clean}} finish. We are working on a way to prevent this from happening, but for the moment it's best to avoid Ctrl+C.'''<br />
<br />
[[Image:viewG192_spw48_1280.png|200px|thumb|right|viewer showing clean spw48 1280x1280 restored image]]<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw48*')<br />
clean(vis='G192_split_6s.ms', spw='48:5~122', \<br />
imagename='imgG192_6s_spw48', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
</source><br />
* Click on the wrench icon [[File:ViewerWrench.png]] to bring up the Data Display Options and change the color scale to "Hot Metal 1" under "basic settings"<br />
* Zoom in 3 times <br />
* Box the point-like source and clean for 50 iterations.<br />
* Stop cleaning when the residuals look like noise (this will probably happen after the first 50 iterations).<br />
* To stop, click the red [[File:clean-stop.png]] button.<br />
<br />
When clean is finished, we can look at the restored image:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw48.image')<br />
</source><br />
<br />
The restored image is shown above. <br />
<br />
Check the rms of the residuals using the {{imstat}} task:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw48.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
In this particular case, it's 136 uJy; yours will likely be slightly different.<br />
<br />
=== Cleaning the lower-frequency baseband ===<br />
<br />
[[Image:viewG192_spw32-63_boxes.png|200px|thumb|right|clean boxes spw32-63]]<br />
[[Image:viewG192_spw32-63.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Here we will image the entire lower-frequency baseband (spw 32-63). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw32-63*')<br />
clean(vis='G192_split_6s.ms', spw='32~63:5~122', \<br />
imagename='imgG192_6s_spw32-63', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw32-63.image')<br />
mystat = imstat('imgG192_6s_spw32-63.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
</source><br />
* Because of the increased bandwidth, it is easier to see two fainter point sources.<br />
* Be careful cleaning sources that lie near or on sidelobe peaks.<br />
* Clean the central emission region first (50 iterations) to reduce the sidelobe level before adding any more components. The screenshot above shows the interactive clean window after 50 iterations with the three clean boxes we created.<br />
<br />
For this run, the rms is 23 uJy. To the right is a zoom-in on the center of the restored image.<br />
<br />
Finally, we will fit the central point source to determine its flux. First, create a box region around the source in the viewer, and save it as <tt>G192.crtf</tt> (View -> Regions -> File; see the screenshot below right). Note that you can drag the Regions window out of the main Viewer window if it's taking up too much space. <br />
<br />
Use this region to fit the source flux:<br />
<source lang="python"><br />
# In CASA<br />
myfit = imfit('imgG192_6s_spw32-63.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
[[Image:viewG192_region.png|200px|thumb|right|saving CASA region for G192]]<br />
<br />
The derived flux is 2.64 +/- 0.04 mJy. Also, have a look at the logger output:<br />
<br />
<pre><br />
Image component size (convolved with beam) ---<br />
--- major axis FWHM: 80.01 +/- 0.98 marcsec<br />
--- minor axis FWHM: 71.51 +/- 1.01 marcsec<br />
--- position angle: 63.2 +/- 2.2 deg<br />
<br />
Clean beam size ---<br />
--- major axis FWHM: 0.06 arcsec<br />
--- minor axis FWHM: 0.06 arcsec<br />
--- position angle: 29.00 deg<br />
Image component size (deconvolved from beam) ---<br />
--- major axis FWHM: 51.3 +/- 1.8 marcsec<br />
--- minor axis FWHM: 37.7 +/- 2.3 marcsec<br />
--- position angle: 78.5 +/- 6.3 deg<br />
</pre><br />
<br />
Although it appears point-like, G192 is actually resolved! The deconvolved size of around 45 milliarcseconds corresponds to a size of 90 AU (assuming a distance of approximately 2 kpc). Indeed, this is thought to be the accretion disk around the protostar! (See [http://www.sciencemag.org/content/292/5521/1513.full?ijkey=y1tFwtUnFnXoc&keytype=ref&siteid=ci this article] for the initial report, using 43 GHz data, of the accretion disk around G192.)<br />
<br />
=== Cleaning the upper-frequency baseband ===<br />
<br />
[[Image:viewG192_spw0-31.png|200px|thumb|right|clean spw32-63 restored image center]]<br />
Now we will image the entire upper-frequency baseband (spw 0-31). Follow the same iterative procedure as before, and get the best residuals you can without "cleaning the noise". <br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-31*')<br />
clean(vis='G192_split_6s.ms', spw='0~31:5~122', \<br />
imagename='imgG192_6s_spw0-31', \<br />
mode='mfs', nterms=1, niter=10000, \<br />
imsize=[1280], cell=['0.015arcsec'], \<br />
imagermode='csclean', cyclefactor=1.5, \<br />
weighting='briggs', robust=0.5, \<br />
interactive=True)<br />
#<br />
viewer('imgG192_6s_spw0-31.image')<br />
mystat = imstat('imgG192_6s_spw0-31.residual')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-31.image', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 31 uJy, and the source flux is 3.07 +/- 0.06 mJy. Again, {{imfit}} finds that the source is extended. To the right is a zoom-in on the center of the restored image.<br />
<br />
=== Cleaning both basebands using two MFS Taylor terms ===<br />
<br />
From the individual images of the upper- and lower-frequency basebands, we can see that the source spectrum of G192 is relatively flat, with a spectral index of approximately <br />
<br />
<math><br />
\alpha = \log(S_1 / S_2) / \log(\nu_1 / \nu_2) <br />
</math><br />
<math><br />
= \log(3.07 / 2.64) / \log(36.5 / 29.0) <br />
</math><br />
<math><br />
= 0.66,<br />
</math><br />
<br />
where the convention for the spectral index alpha is that <br />
<br />
<math><br />
S \propto \nu^\alpha.<br />
</math><br />
<br />
Within a single baseband, neglecting to account for the spectral index will make little difference -- however, when we combine the two basebands, it is best to account for the spectral variation across the total band. For this, we will set <tt>nterms=2</tt> in {{clean}}.<br />
<br />
This option creates two "Taylor term" images -- an average intensity image (with suffix <tt>.image.tt0</tt>), and a spectral slope image (with suffix <tt>.image.tt1</tt>), which is intensity x alpha (where alpha is the spectral index). For convenience, there is also a spectral index image (with suffix <tt>.image.alpha</tt>). These Taylor expansions are with respect to the "reference frequency" of the image (by default the center frequency of the selected spectral window, but can be specified using the <tt>reffreq</tt> parameter in {{clean}}). <br />
<br />
We will clean the complete dataset using <tt>nterms=2</tt> Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set <tt>mask='imgG192_6s_spw0-31.mask'</tt> or <tt>mask='imgG192_6s_spw32-63.mask'</tt> to use these as a starting point rather than running an interactive clean session. In this case, you should modify the <tt>threshold</tt> and <tt>niter</tt> parameters to avoid over-cleaning.<br />
<br />
<source lang="python"><br />
# In CASA<br />
# Removing any previous cleaning information<br />
# This assumes you want to start this clean from scratch<br />
# If you want to continue this from a previous clean run, <br />
# the rm -rf system command should be be skipped<br />
os.system ('rm -rf imgG192_6s_spw0-63_mfs2*')<br />
clean(vis='G192_split_6s.ms', spw='0~63:5~122', \<br />
imagename='imgG192_6s_spw0-63_mfs2', \<br />
mode='mfs', nterms=2, niter=10000, gain=0.1, \<br />
threshold='0.0mJy', psfmode='clark', imsize=[1280], \<br />
cell=['0.015arcsec'], \<br />
weighting='briggs', robust=0.5, interactive=True)<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.residual.tt0')<br />
print 'Residual standard deviation = '+str(mystat['sigma'][0])<br />
myfit = imfit('imgG192_6s_spw0-63_mfs2.image.tt0', region='G192.crtf')<br />
print 'Source flux = '+str(myfit['results']['component0']['flux']['value'][0])+'+/-'+str(myfit['results']['component0']['flux']['error'][0])<br />
</source><br />
<br />
For this run, the rms is 19.7 uJy, and the peak of the emission from G192 is 1.8 mJy, and the integrated source flux is 2.86 +/- 0.04 mJy (as before, the source is found to be extended). You can use the {{viewer}} to load the average intensity image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.tt0')<br />
</source><br />
<br />
[[Image:viewG192_spw0-63_mfs2loadalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 load alpha with LEL]]<br />
<br />
Since the spectral index image is very noisy in the lower-intensity regions, we will use {{immath}} task to filter the spectral index image explicitly, using a Lattice Expression Language (LEL) expression:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2.0E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
This will use 0.2 mJy (10 x the rms) as the cutoff. You can then view or manipulate the filtered alpha image as usual.<br />
<br />
We can also use LEL to filter the alpha image on intensity on-the-fly when we load the raster via the Open Data panel, by specifying a LEL string in the LEL box instead of selecting the image from the directory listing. The LEL string<br />
<pre><br />
'imgG192_6s_spw0-63_mfs2.image.alpha'['imgG192_6s_spw0-63_mfs2.image.tt0'>2E-04]<br />
</pre><br />
will replicate what we did above. The middle figure to the right shows the Open Data panel with our LEL string in it. Just click the Raster button to load this.<br />
<br />
[[Image:viewG192_spw0-63_mfs2panelalpha.png|200px|thumb|right|clean spw0-63 mfs nterms=2 tt0 and alpha (filtered at 0.2 mJy in tt0)]]<br />
[[Image:viewG192_spw0-63_mfs2panelalphaerr.png|200px|thumb|right|clean spw0-63 mfs nterms=2 alpha and alpha error (filtered at 0.2 mJy in tt0)]]<br />
<br />
The lower panel to the right shows the intensity and LEL-filtered alpha images side-by-side in the viewer, zoomed in on the brightest source of emission. Creating a box around this region and double-clicking reveals that the spectral index varies from around -0.33 to 1.4, with the pixels in the brightest portion of the image at around 0.8, similar to what we found by hand using the information from the single-baseband images. <br />
<br />
To get a sense of the probable errors for this spectral index information, we perform a similar filtering operation on the <tt>imgG192_6s_spw0-63_mfs2.image.alpha.error>/tt> image:<br />
<br />
<source lang="python"><br />
# In CASA<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.alpha.error', <br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.alpha.error.filtered')<br />
</source><br />
<br />
Now, we can load both the <tt>alpha</tt> and <tt>alpha.error</tt> images side-by-side in the viewer:<br />
<source lang="python"><br />
# In CASA<br />
viewer('imgG192_6s_spw0-63_mfs2.image.alpha.filtered')<br />
</source><br />
<br />
As one might expect, the errors are higher outside the emission peak (see the screenshot on the right). However, it seems possible that the <tt>.error</tt> image is underestimating the true errors on the mfs-calculated spectral index, since the central brightest pixels only have errors of around 0.15, when we calculated an alpha of 0.66 (compared with the mfs-calculated alpha of 0.8). If we were planning to use the reported spectral index information for publication, we would need to go through a more thorough investigation of the actual error analysis and spectral index.<br />
<br />
== Analyzing the image ==<br />
<br />
From {{imstat}} on the final combined-baseband image, we got an image rms of 19.7 uJy. A reasonable question to ask is what we would <i>expect</i> the image rms to be: one way to estimate this is to determine the effective on-source time, then input the appropriate parameters to the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] to determine the expected rms.<br />
<br />
<source lang="python"><br />
# In CASA<br />
listobs('G192_split_6s.ms', listunfl=True)<br />
</source><br />
<br />
This will show:<br />
<pre><br />
ID Code Name RA Decl Epoch SrcId nRows nUnflRows<br />
0 NONE G192.16-3.84 05:58:13.540000 +16.31.58.30001 J2000 0 2931890 2901697.32<br />
</pre><br />
Note that the "nUnflRows," or number of unflagged rows, is 2901697.32. Every row is a single baseline-integration-spw record, as you probably learned if you looked at the MS with {{browsetable}}. So, to use this to calculate an "effective" exposure time for the VLA Exposure Calculator for 22 antennas (22*21/2 = 231 baselines), we find that time = 2901697.32 * 6 seconds / 231 baselines / 64 spectral windows = 1178 seconds = 19.6 minutes. Our effective bandwidth is 7552 MHz, taking into account the spectral window selection. Using the median frequency of 32.7 GHz, the [https://science.nrao.edu/facilities/vla/proposing/evlaExpoCalc.jnlp VLA exposure calculator] reports that we should achieve an image rms of 13.5 uJy. Although our actual rms is somewhat higher, this is not unexpected; we have not done any self-calibration, for example.<br />
<br />
Next, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index for G192. The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image (see the figure to the right). Let's filter this Taylor-term image by intensity as we did with the <tt>.alpha</tt> image:<br />
<source lang="python"><br />
# In CASA<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt1',<br />
'imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM1>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt1.filtered')<br />
#<br />
# Removing any file output from previous runs, so immath will proceed<br />
os.system('rm -rf imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
immath(imagename=['imgG192_6s_spw0-63_mfs2.image.tt0'],<br />
mode='evalexpr',<br />
expr='IM0[IM0>2E-4]',<br />
outfile='imgG192_6s_spw0-63_mfs2.image.tt0.filtered')<br />
</source><br />
<br />
We can use the same region we created for {{imstat}}. Let us compute the intensity-weighted spectral index over this region by averaging these masked images using {{imstat}} and computing the ratio:<br />
<source lang="python"><br />
# In CASA<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt1.filtered',<br />
region='G192.crtf')<br />
avgtt0alpha = mystat['mean'][0]<br />
#<br />
mystat = imstat('imgG192_6s_spw0-63_mfs2.image.tt0.filtered',<br />
region='G192.crtf')<br />
avgtt0 = mystat['mean'][0]<br />
avgalpha = avgtt0alpha / avgtt0<br />
print 'G192 intensity-weighted alpha = ' + str(avgalpha)<br />
</source><br />
We get: <br />
<pre><br />
G192 intensity-weighted alpha = 0.737300481129<br />
</pre><br />
<br />
This is pretty close to the value we found from the single-baseband images of alpha = 0.66, validating the results from mfs with <tt>nterms=2</tt>.<br />
<br />
== What to do next: some exercises for the user ==<br />
<br />
Here are a number of things you can try after completing this tutorial:<br />
<br />
# Use self-calibration to improve the data and re-clean to make a better image. See [http://casaguides.nrao.edu/index.php?title=WorkshopSelfcal_(Caltech) this tutorial] for more information on self-calibration.<br />
# Investigate the data further to see if any more flagging is needed.<br />
# Image the calibrators. What sort of dynamic range can you get on them? Is self-calibration needed (and if so what dynamic range do you get when you use it)?<br />
# Try the <tt>rflag</tt> algorithm in the flagdata task to automatically flag bad data based on the statistics of the data (though there is not much left, really). There is more information on running the <tt>rflag</tt> algorithm in [http://casaguides.nrao.edu/index.php?title=EVLA_Wide-Band_Wide-Field_Imaging:_G55.7_3.4 this tutorial].<br />
<br />
== Credits ==<br />
<br />
<blockquote><i><br />
The Jansky Very Large Array (VLA) is a partnership of the United States, Canada, and Mexico. The VLA is funded in the United States by the National Science Foundation, in Canada by the National Research Council, and in Mexico by the Comisión Nacional de Investigación Científica y Tecnológica (CONICyT).<br />
</i></blockquote><br />
<br />
<blockquote><i><br />
The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.<br />
</i></blockquote><br />
<br />
{{Checked 4.2.0}}</div>Knyland