EVLA 6-cm Wideband Tutorial SN2010FZ (Caltech): Difference between revisions

From CASA Guides
Jump to navigationJump to search
Mkrauss (talk | contribs)
Mkrauss (talk | contribs)
 
(40 intermediate revisions by the same user not shown)
Line 34: Line 34:
{{GettingCaltechData}}
{{GettingCaltechData}}


While you should read through the first few sections, the Measurement Set (MS) you will be starting with has already had the first few steps performed, to save both time and disk space.  To copy this your local directory, do the following:
While you should read through the first few sections, the Measurement Set (MS) you will be starting with has already had the first few steps performed, to save both time and disk space.  To copy this your local directory, do the following (substitute your username number for the "??", and use either <tt>/scr</tt> or <tt>/scr2</tt>, depending on your node assignment):


<source lang="bash">
<source lang="bash">
cd /scr[2]/casa/
cd /scr[2]/casa/
mkdir casauser??
cd casauser??
mkdir evla_6-cm_wideband
mkdir evla_6-cm_wideband
cd evla_6-cm_wideband
cd evla_6-cm_wideband
tar -xvf /data/casa/evla/tar/SN2010FZ.filled.10s.tar
tar -xvf /data/casa/evla/tar/SN2010FZ_10s.tar
</source>
</source>


Note that you will need to use either <tt>/scr</tt> or <tt>/scr2</tt>, depending on your node assignment.  This will take a minute, but once it's complete, you will have a directory called <tt>SN2010FZ_filled10s.ms</tt> which is the filled data, with online flags applied (which delete known bad data), and time-averaged to 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.)  This is equivalent to what you would download from the archive if you request time-averaging and online flag application.
This will take a minute, but once it's complete, you will have a directory called <tt>SN2010FZ_10s.ms</tt> which is the filled data, with online flags applied (which delete known bad data), and time-averaged to 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.)  This is equivalent to what you would download from the archive if you request time-averaging and online flag application.


=== On your own ===
=== On your own ===
Line 53: Line 55:
{{CaltechCASAStartup}}
{{CaltechCASAStartup}}


== Examining and Flagging your Averaged MS ==
== Examining the MS ==


We use {{listobs}} to summarize our MS:
We use {{listobs}} to summarize our MS:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
listobs('SN2010FZ_filled10s.ms')
listobs('SN2010FZ_10s.ms')
</source>
</source>


Line 64: Line 66:


<pre>
<pre>
#####################################
##########################################
Begin Task: listobs            #####
##### Begin Task: listobs            #####


==============================================================================
================================================================================
        MeasurementSet Name:  /scr2/casa/evla_6-cm_wideband/SN2010FZ_filled10s.ms      MS Version 2
          MeasurementSet Name:  /scr2/casa/evla_6-cm_wideband/SN2010FZ_10s.ms      MS Version 2
==============================================================================
================================================================================
Observer: Dr. Alicia M. Soderberg    Project: T.B.D.   
  Observer: Dr. Alicia M. Soderberg    Project: T.B.D.   
Observation: EVLA
Observation: EVLA
Data records: 1570154       Total integration time = 3359 seconds
Data records: 1570726       Total integration time = 3359 seconds
Observed from  11-Jul-2010/21:30:44.0  to  11-Jul-2010/22:26:43.0 (UTC)
  Observed from  11-Jul-2010/21:30:44.0  to  11-Jul-2010/22:26:43.0 (UTC)


ObservationID = 0        ArrayID = 0
  ObservationID = 0        ArrayID = 0
Date        Timerange (UTC)          Scan  FldId FieldName          nRows  Int(s)  SpwIds      ScanIntent
  Date        Timerange (UTC)          Scan  FldId FieldName          nRows  Int(s)  SpwIds      ScanIntent
11-Jul-2010/21:30:44.0 - 21:30:52.0    2      0 J0925+0019          362   6.71     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
  11-Jul-2010/21:30:44.0 - 21:30:52.0    2      0 J0925+0019          404   6.43     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
            21:31:02.0 - 21:32:22.0    3      0 J0925+0019          5061   9.65     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
              21:31:02.0 - 21:32:22.0    3      0 J0925+0019          5062   9.68     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
            21:32:32.0 - 21:33:52.0    4      0 J0925+0019          6277  9.91    [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
              21:32:32.0 - 21:33:52.0    4      0 J0925+0019          6277  9.91    [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
            21:34:02.0 - 21:34:52.0    5      0 J0925+0019          4148  9.96    [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
              21:34:02.0 - 21:34:52.0    5      0 J0925+0019          4148  9.96    [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
            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
              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
            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
              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
            21:38:44.0 - 21:39:51.0    9      1 SN2010FZ            43520  9.11     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED
              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
            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
              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
            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
              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
            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
              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
            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
              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
            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
              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
            21:47:29.0 - 21:47:48.5   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
              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
            21:48:12.0 - 21:49:18.5    16      0 J0925+0019          43520  8.92    [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED
              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
            21:49:42.0 - 21:50:49.0    17      1 SN2010FZ            43520  9.11     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED
              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
            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
              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
            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
              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
            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
              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
            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
              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
            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
              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
            21:58:28.0 - 21:58:47.0   23      1 SN2010FZ            16320  9.33     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED
              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
            21:59:11.0 - 22:00:17.0    24      0 J0925+0019          43520  8.93     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED
              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
            22:00:40.0 - 22:01:47.0    25      1 SN2010FZ            43520  9.12     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED
              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
            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
              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
            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
              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
            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
              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
            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
              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
            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
              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
            22:09:26.0 - 22:09:45.0   31      1 SN2010FZ            16320  9.33     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED
              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
            22:10:08.5 - 22:11:15.0   32      0 J0925+0019          43520  8.94     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED
              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
            22:11:38.5 - 22:12:45.5    33      1 SN2010FZ            43520  9.11     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED
              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
            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
              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
            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
              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
            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
              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
            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
              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
            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
              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
            22:20:24.0 - 22:20:43.5    39      1 SN2010FZ            16320  9.6      [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]OBSERVE_TARGET#UNSPECIFIED
              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
            22:21:06.5 - 22:22:13.5    40      0 J0925+0019          42690  8.96     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_PHASE#UNSPECIFIED
              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
            22:25:13.0 - 22:25:13.0    42      2 3C286              860    2.64     [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED
              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
            22:25:23.0 - 22:26:43.0    43      2 3C286              47396 9.62    [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED
              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
        (nVis = Total number of time/baseline visibilities per scan)  
          (nVis = Total number of time/baseline visibilities per scan)  
elds: 3
Fields: 3
ID  Code Name                RA              Decl          Epoch  SrcId nVis   
  ID  Code Name                RA              Decl          Epoch  SrcId nVis   
0    D    J0925+0019          09:25:07.81503 +00.19.13.9334 J2000  0    303338
  0    D    J0925+0019          09:25:07.81503 +00.19.13.9334 J2000  0    303381
1    NONE SN2010FZ            09:42:04.77000 +00.19.51.0000 J2000  1    1218560
  1    NONE SN2010FZ            09:42:04.77000 +00.19.51.0000 J2000  1    1218560
2    K    3C286              13:31:08.28798 +30.30.32.9589 J2000  2    48256  
  2    K    3C286              13:31:08.28798 +30.30.32.9589 J2000  2    48785  
(nVis = Total number of time/baseline visibilities per field)  
  (nVis = Total number of time/baseline visibilities per field)  
ectral Windows:  (18 unique spectral windows and 1 unique polarization setups)
Spectral Windows:  (18 unique spectral windows and 1 unique polarization setups)
SpwID  #Chans Frame Ch1(MHz)    ChanWid(kHz)  TotBW(kHz)  Corrs           
  SpwID  #Chans Frame Ch1(MHz)    ChanWid(kHz)  TotBW(kHz)  Corrs           
0          64 TOPO  7686        2000          128000      RR  RL  LR  LL   
  0          64 TOPO  7686        2000          128000      RR  RL  LR  LL   
1          64 TOPO  7836        2000          128000      RR  RL  LR  LL   
  1          64 TOPO  7836        2000          128000      RR  RL  LR  LL   
2          64 TOPO  4488        2000          128000      RR  RL  LR  LL   
  2          64 TOPO  4488        2000          128000      RR  RL  LR  LL   
3          64 TOPO  4616        2000          128000      RR  RL  LR  LL   
  3          64 TOPO  4616        2000          128000      RR  RL  LR  LL   
4          64 TOPO  4744        2000          128000      RR  RL  LR  LL   
  4          64 TOPO  4744        2000          128000      RR  RL  LR  LL   
5          64 TOPO  4872        2000          128000      RR  RL  LR  LL   
  5          64 TOPO  4872        2000          128000      RR  RL  LR  LL   
6          64 TOPO  5000        2000          128000      RR  RL  LR  LL   
  6          64 TOPO  5000        2000          128000      RR  RL  LR  LL   
7          64 TOPO  5128        2000          128000      RR  RL  LR  LL   
  7          64 TOPO  5128        2000          128000      RR  RL  LR  LL   
8          64 TOPO  5256        2000          128000      RR  RL  LR  LL   
  8          64 TOPO  5256        2000          128000      RR  RL  LR  LL   
9          64 TOPO  5384        2000          128000      RR  RL  LR  LL   
  9          64 TOPO  5384        2000          128000      RR  RL  LR  LL   
10        64 TOPO  6488        2000          128000      RR  RL  LR  LL   
  10        64 TOPO  6488        2000          128000      RR  RL  LR  LL   
11        64 TOPO  6616        2000          128000      RR  RL  LR  LL   
  11        64 TOPO  6616        2000          128000      RR  RL  LR  LL   
12        64 TOPO  6744        2000          128000      RR  RL  LR  LL   
  12        64 TOPO  6744        2000          128000      RR  RL  LR  LL   
13        64 TOPO  6872        2000          128000      RR  RL  LR  LL   
  13        64 TOPO  6872        2000          128000      RR  RL  LR  LL   
14        64 TOPO  7000        2000          128000      RR  RL  LR  LL   
  14        64 TOPO  7000        2000          128000      RR  RL  LR  LL   
15        64 TOPO  7128        2000          128000      RR  RL  LR  LL   
  15        64 TOPO  7128        2000          128000      RR  RL  LR  LL   
16        64 TOPO  7256        2000          128000      RR  RL  LR  LL   
  16        64 TOPO  7256        2000          128000      RR  RL  LR  LL   
17        64 TOPO  7384        2000          128000      RR  RL  LR  LL   
  17        64 TOPO  7384        2000          128000      RR  RL  LR  LL   
urces: 50
Sources: 50
ID  Name                SpwId RestFreq(MHz)  SysVel(km/s)  
  ID  Name                SpwId RestFreq(MHz)  SysVel(km/s)  
0    J0925+0019          0    -              -             
  0    J0925+0019          0    -              -             
0    J0925+0019          1    -              -             
  0    J0925+0019          1    -              -             
0    J0925+0019          2    -              -             
  0    J0925+0019          2    -              -             
0    J0925+0019          3    -              -             
  0    J0925+0019          3    -              -             
0    J0925+0019          4    -              -             
  0    J0925+0019          4    -              -             
0    J0925+0019          5    -              -             
  0    J0925+0019          5    -              -             
0    J0925+0019          6    -              -             
  0    J0925+0019          6    -              -             
0    J0925+0019          7    -              -             
  0    J0925+0019          7    -              -             
0    J0925+0019          8    -              -             
  0    J0925+0019          8    -              -             
0    J0925+0019          9    -              -             
  0    J0925+0019          9    -              -             
0    J0925+0019          10    -              -             
  0    J0925+0019          10    -              -             
0    J0925+0019          11    -              -             
  0    J0925+0019          11    -              -             
0    J0925+0019          12    -              -             
  0    J0925+0019          12    -              -             
0    J0925+0019          13    -              -             
  0    J0925+0019          13    -              -             
0    J0925+0019          14    -              -             
  0    J0925+0019          14    -              -             
0    J0925+0019          15    -              -             
  0    J0925+0019          15    -              -             
0    J0925+0019          16    -              -             
  0    J0925+0019          16    -              -             
0    J0925+0019          17    -              -             
  0    J0925+0019          17    -              -             
1    SN2010FZ            2    -              -             
  1    SN2010FZ            2    -              -             
1    SN2010FZ            3    -              -             
  1    SN2010FZ            3    -              -             
1    SN2010FZ            4    -              -             
  1    SN2010FZ            4    -              -             
1    SN2010FZ            5    -              -             
  1    SN2010FZ            5    -              -             
1    SN2010FZ            6    -              -             
  1    SN2010FZ            6    -              -             
1    SN2010FZ            7    -              -             
  1    SN2010FZ            7    -              -             
1    SN2010FZ            8    -              -             
  1    SN2010FZ            8    -              -             
1    SN2010FZ            9    -              -             
  1    SN2010FZ            9    -              -             
1    SN2010FZ            10    -              -             
  1    SN2010FZ            10    -              -             
1    SN2010FZ            11    -              -             
  1    SN2010FZ            11    -              -             
1    SN2010FZ            12    -              -             
  1    SN2010FZ            12    -              -             
1    SN2010FZ            13    -              -             
  1    SN2010FZ            13    -              -             
1    SN2010FZ            14    -              -             
  1    SN2010FZ            14    -              -             
1    SN2010FZ            15    -              -             
  1    SN2010FZ            15    -              -             
1    SN2010FZ            16    -              -             
  1    SN2010FZ            16    -              -             
1    SN2010FZ            17    -              -             
  1    SN2010FZ            17    -              -             
2    3C286              2    -              -             
  2    3C286              2    -              -             
2    3C286              3    -              -             
  2    3C286              3    -              -             
2    3C286              4    -              -             
  2    3C286              4    -              -             
2    3C286              5    -              -             
  2    3C286              5    -              -             
2    3C286              6    -              -             
  2    3C286              6    -              -             
2    3C286              7    -              -             
  2    3C286              7    -              -             
2    3C286              8    -              -             
  2    3C286              8    -              -             
2    3C286              9    -              -             
  2    3C286              9    -              -             
2    3C286              10    -              -             
  2    3C286              10    -              -             
2    3C286              11    -              -             
  2    3C286              11    -              -             
2    3C286              12    -              -             
  2    3C286              12    -              -             
2    3C286              13    -              -             
  2    3C286              13    -              -             
2    3C286              14    -              -             
  2    3C286              14    -              -             
2    3C286              15    -              -             
  2    3C286              15    -              -             
2    3C286              16    -              -             
  2    3C286              16    -              -             
2    3C286              17    -              -             
  2    3C286              17    -              -             
Antennas: 27:
Antennas: 27:
   ID  Name  Station  Diam.    Long.        Lat.         
   ID  Name  Station  Diam.    Long.        Lat.         
Line 230: Line 232:
</pre>
</pre>


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 (1570154) 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 X 360 X 16 = 2021760.  Note that this is high by ~30%; this is because we have 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).
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 X 360 X 16 = 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).


The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings.   
The most useful parts of the {{listobs}} output are the scan, field, and spectral window listings.   
Line 240: Line 242:
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.   
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.   


The field listing shows three sources: J0925+0019 (also referred to by its field ID, 0), the phase calibration source, SN2010FZ (1), our science target, and 3C286 (2), which will provide our flux standard.
The field listing shows three sources:  
 
* J0925+0019 (also referred to by its field ID, 0), which will serve as a calibrator for the visibility phases,  
* SN2010FZ (1), our science target field, and  
* 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.
 
== Flagging the MS ==


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_filled10s.ms</tt>.)
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>.)


[[Image:plotSN2010FZ_flagcmd.png|200px|thumb|right|online flags plotted from flagcmd]]
[[Image:plotSN2010FZ_flagcmd.png|200px|thumb|right|online flags plotted from flagcmd]]
Line 248: Line 256:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
flagcmd(vis='SN2010FZ_filled10s.ms',flagmode='table',optype='list')
flagcmd(vis='SN2010FZ_10s.ms',flagmode='table',optype='list')
</source>
</source>
These will go to the logger.
These will go to the logger.
Line 256: Line 264:
# In CASA
# In CASA
myrows = range(285)
myrows = range(285)
flagcmd(vis='SN2010FZ_filled.ms',flagmode='table',optype='plot',flagrows=myrows)
flagcmd(vis='SN2010FZ_10s.ms',flagmode='table',optype='plot',flagrows=myrows)
</source>
</source>
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].
This will bring up a <tt>matplotlib</tt> plotter.  You can have it plot to a PNG file instead:
This will bring up a <tt>matplotlib</tt> plotter.  You can have it plot to a PNG file instead:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
flagcmd(vis='SN2010FZ_filled.ms',flagmode='table',optype='plot',flagrows=myrows,outfile='plotSN2010FZ_flagcmd.png')
flagcmd(vis='SN2010FZ_10s.ms',flagmode='table',optype='plot',flagrows=myrows,outfile='plotSN2010FZ_flagcmd.png')
</source>
</source>


Line 272: Line 284:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotants('SN2010FZ_filled10s.ms')
plotants('SN2010FZ_10s.ms')
</source>
</source>


Line 282: Line 294:
</source>
</source>


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 that 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.  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.
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.   
 
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.


NOTE: If you need an introduction to {{plotms}}, see:
NOTE: If you need an introduction to {{plotms}}, see:
Line 291: Line 305:
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!
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!


The useful spw are 2~17. To get an idea of the data layout, plot a single baseline/channel versus time:
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:
 
[[Image:plotSN2010FZ_plotms_ants1.png|200px|thumb|right|plotms amp vs time]]
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='',spw='2~17:31~31', \
plotms(vis='SN2010FZ_10s.ms',field='',spw='2~17:31~31', \
       antenna='ea01&ea02',correlation='RR,LL',xaxis='time',yaxis='amp')
       antenna='ea01&ea02',correlation='RR,LL',xaxis='time',yaxis='amp')
</source>
</source>
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".


[[Image:plotSN2010FZ_plotms_ants.png|200px|thumb|right|plotms ant2 vs ea01]]
[[Image:plotSN2010FZ_plotms_ants.png|200px|thumb|right|plotms ant2 vs ea01]]
Line 302: Line 320:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='2',spw='2~17:31~31', \
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17:31~31', \
       antenna='ea01',correlation='RR,LL',xaxis='antenna2',yaxis='amp')
       antenna='ea01',correlation='RR,LL',xaxis='antenna2',yaxis='amp')
</source>
</source>
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.
 
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.)


[[Image:plotSN2010FZ_plotms_ea02.png|200px|thumb|right|plotms ea02 vs frequency]]
[[Image:plotSN2010FZ_plotms_ea02.png|200px|thumb|right|plotms ea02 vs frequency]]
Now look at the bandpass for ea02 - it is in the inner core and a prospective reference antenna. Exclude ea13 using negation in the selection:
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:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='2',spw='2~17', \
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17', \
       antenna='ea02;!ea13',correlation='RR,LL',xaxis='frequency',yaxis='amp')
       antenna='ea02;!ea13',correlation='RR,LL',xaxis='frequency',yaxis='amp')
</source>
</source>
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 6614MHz (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.
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.


[[Image:plotSN2010FZ_plotms_ea02ea20.png|200px|thumb|right|plotms ea02&ea20 iteration phase vs frequency]]
[[Image:plotSN2010FZ_plotms_ea02ea20.png|200px|thumb|right|plotms ea02&ea20 iteration phase vs frequency]]
We can also step through the baselines to our antenna using iteraxis - use the ">" button to step through:
We can also step through the baselines to our antenna using iteraxis - use the '''Next Iteration''' [[Image:NextIterationButton.png]] button to step through:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',iteraxis='baseline')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',iteraxis='baseline')
</source>
</source>
Line 326: Line 345:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \
       correlation='RR,LL',xaxis='frequency',yaxis='phase',iteraxis='baseline')
       correlation='RR,LL',xaxis='frequency',yaxis='phase',iteraxis='baseline')
</source>
</source>
You see the slopes due to residual delays. Mostly a turn or less over a 128MHz subband, but there are some outliers.
You see the slopes due to residual delays. Mostly a turn or less over a 128MHz subband, but there are some outliers.
Step through to ea20.  You see that there is a very large delay in RR (via locate) for
Step through to ea20.  You see that there is a very large delay in RR (via locate) for
the first baseband (spw 0~7).  We will delete this (will also delete LL so there are no orphan polarization products).
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).
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.
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.


Line 341: Line 360:
             'antenna="ea25" spw="10~17"',
             'antenna="ea25" spw="10~17"',
             'antenna="ea20" spw="2~9"']
             'antenna="ea20" spw="2~9"']
flagcmd(vis='SN2010FZ_filled10s.ms',flagmode='cmd',command=flaglist,optype='apply',flagbackup=False)
flagcmd(vis='SN2010FZ_10s.ms',flagmode='cmd',command=flaglist,optype='apply',flagbackup=False)
</source>
</source>
These commands will be carried out as well as being added to the FLAG_CMD table (marked as applied).
These commands will be carried out as well as being added to the FLAG_CMD table (marked as applied).


Plot the data again now having flagged:
Plot the data again, now that is has been flagged:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='2',spw='2~17',antenna='ea02', \
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~44')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')
</source>
</source>


[[Image:plotSN2010FZ_plotms_ea02fld0.png|200px|thumb|right|plotms field 0 ea02 amp vs frequency]]
[[Image:plotSN2010FZ_plotms_ea02fld0.png|200px|thumb|right|plotms field 0 ea02 amp vs frequency]]
Now our phase calibrator - it is weaker, and we now start to see the RFI:
Now our phase calibrator - it is weaker, and we now start to really see the RFI:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='0',spw='2~17',antenna='ea02', \
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17',antenna='ea02', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~44')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')
</source>
</source>
Use the Zoom feature, Mark rectangles and use Locate to identify the frequency/channel of RFI. In particular, we note in our analysis:
Use the Zoom feature, Mark rectangles and use Locate to identify the frequency/channel of RFI. In particular, we note in our analysis:
Line 368: Line 387:
* 7488MHz (spw 17 ch 52)
* 7488MHz (spw 17 ch 52)


If you plot all antennas and avoid the band edges you see spw 16,17 are pretty wiped out:
If you plot all antennas and avoid the band edges you see spw 16 and 17 are pretty wiped out:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_filled10s.ms',field='0',spw='2~17:4~59',antenna='', \
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17:4~59',antenna='', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~44')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')
</source>
</source>
For now we will not flag these channels but note them to mask out when creating continuum calibration tables and images.


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 selection:
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.
 
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.
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
split(vis='SN2010FZ_filled10s.ms',outputvis='SN2010FZ_flagged10s.ms',datacolumn='data',spw='2~9,12~17',scan='7~44')
split(vis='SN2010FZ_10s.ms',outputvis='SN2010FZ_flagged10s.ms',datacolumn='data',spw='2~9,12~17',scan='7~43')
</source>
</source>


You now have a MS called <tt>SN2010FZ_flagged10s.ms</tt> in your working area.  This should be 2.8GB in size.
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:
 
<source lang="python">
# In CASA
os.system('du -sh SN2010FZ_flagged10s.ms')
</source>
 
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.)


== Calibration ==
== Calibration ==
Line 393: Line 421:
In the logger we see:
In the logger we see:
<pre>
<pre>
##########################################
##### Begin Task: listobs            #####
================================================================================
================================================================================
           MeasurementSet Name:  /home/sandrock2/smyers/casa/tutorials/SN2010FZ/SN2010FZ_flagged10s.ms      MS Version 2
           MeasurementSet Name:  /scr2/casa/evla_6-cm_wideband/SN2010FZ_flagged10s.ms      MS Version 2
================================================================================
================================================================================
   Observer: Dr. Alicia M. Soderberg    Project: T.B.D.   
   Observer: Dr. Alicia M. Soderberg    Project: T.B.D.   
Observation: EVLA
Observation: EVLA
Data records: 1374548       Total integration time = 3042 seconds
Data records: 1375038       Total integration time = 3042 seconds
   Observed from  11-Jul-2010/21:36:01.0  to  11-Jul-2010/22:26:43.0 (UTC)
   Observed from  11-Jul-2010/21:36:01.0  to  11-Jul-2010/22:26:43.0 (UTC)


   ObservationID = 0        ArrayID = 0
   ObservationID = 0        ArrayID = 0
   Date        Timerange (UTC)          Scan  FldId FieldName nVis   Int(s)  SpwIds      ScanIntent
   Date        Timerange (UTC)          Scan  FldId FieldName           nRows   Int(s)  SpwIds      ScanIntent
   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
   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
               21:38:44.0 - 21:39:51.0    9      1 SN2010FZ     39312  9.11     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               21:47:29.0 - 21:47:48.5   15      1 SN2010FZ     14742  9.67    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               21:48:12.0 - 21:49:18.5    16      0 J0925+0019   39312  8.92    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED
               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
               21:49:42.0 - 21:50:49.0    17      1 SN2010FZ     39312  9.11     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               21:58:28.0 - 21:58:47.0   23      1 SN2010FZ     14742  9.33     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               21:59:11.0 - 22:00:17.0    24      0 J0925+0019   39312  8.93     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED
               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
               22:00:40.0 - 22:01:47.0    25      1 SN2010FZ     39312  9.12     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               22:09:26.0 - 22:09:45.0   31      1 SN2010FZ     14742  9.33     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               22:10:08.5 - 22:11:15.0   32      0 J0925+0019   39312  8.94     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED
               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
               22:11:38.5 - 22:12:45.5    33      1 SN2010FZ     39312  9.11     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               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
               22:20:24.0 - 22:20:43.5    39      1 SN2010FZ     14742  9.6      [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]OBSERVE_TARGET#UNSPECIFIED
               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
               22:21:06.5 - 22:22:13.5    40      0 J0925+0019   38584  8.96     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_PHASE#UNSPECIFIED
               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
               22:25:13.0 - 22:25:13.0    42      2 3C286       770   2.65     [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED
               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
               22:25:23.0 - 22:26:43.0    43      2 3C286       42812 9.62    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]CALIBRATE_BANDPASS#UNSPECIFIED,CALIBRATE_AMPLI#UNSPECIFIED
               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
           (nVis = Total number of time/baseline visibilities per scan)  
           (nVis = Total number of time/baseline visibilities per scan)  
Fields: 3
Fields: 3
   ID  Code Name         RA           Decl           Epoch  SrcId nVis   
   ID  Code Name               RA             Decl         Epoch  SrcId nVis   
   0    D    J0925+0019   09:25:07.8150 +00.19.13.9334 J2000  0    230230  
   0    D    J0925+0019         09:25:07.81503 +00.19.13.9334 J2000  0    230230  
   1    NONE SN2010FZ     09:42:04.7700 +00.19.51.0000 J2000  1    1100736
   1    NONE SN2010FZ           09:42:04.77000 +00.19.51.0000 J2000  1    1100736
   2    K    3C286       13:31:08.2880 +30.30.32.9589 J2000  2    43582  
   2    K    3C286               13:31:08.28798 +30.30.32.9589 J2000  2    44072  
   (nVis = Total number of time/baseline visibilities per field)  
   (nVis = Total number of time/baseline visibilities per field)  
Spectral Windows:  (14 unique spectral windows and 1 unique polarization setups)
Spectral Windows:  (14 unique spectral windows and 1 unique polarization setups)
   SpwID  #Chans Frame Ch1(MHz)    ChanWid(kHz)TotBW(kHz)  Ref(MHz)    Corrs          
   SpwID  #Chans Frame Ch1(MHz)    ChanWid(kHz) TotBW(kHz)  Corrs        
   0          64 TOPO  4488        2000       128000      4488        RR  RL  LR  LL   
   0          64 TOPO  4488        2000         128000      RR  RL  LR  LL   
   1          64 TOPO  4616        2000       128000      4616        RR  RL  LR  LL   
   1          64 TOPO  4616        2000         128000      RR  RL  LR  LL   
   2          64 TOPO  4744        2000       128000      4744        RR  RL  LR  LL   
   2          64 TOPO  4744        2000         128000      RR  RL  LR  LL   
   3          64 TOPO  4872        2000       128000      4872        RR  RL  LR  LL   
   3          64 TOPO  4872        2000         128000      RR  RL  LR  LL   
   4          64 TOPO  5000        2000       128000      5000        RR  RL  LR  LL   
   4          64 TOPO  5000        2000         128000      RR  RL  LR  LL   
   5          64 TOPO  5128        2000       128000      5128        RR  RL  LR  LL   
   5          64 TOPO  5128        2000         128000      RR  RL  LR  LL   
   6          64 TOPO  5256        2000       128000      5256        RR  RL  LR  LL   
   6          64 TOPO  5256        2000         128000      RR  RL  LR  LL   
   7          64 TOPO  5384        2000       128000      5384        RR  RL  LR  LL   
   7          64 TOPO  5384        2000         128000      RR  RL  LR  LL   
   8          64 TOPO  6744        2000       128000      6744        RR  RL  LR  LL   
   8          64 TOPO  6744        2000         128000      RR  RL  LR  LL   
   9          64 TOPO  6872        2000       128000      6872        RR  RL  LR  LL   
   9          64 TOPO  6872        2000         128000      RR  RL  LR  LL   
   10        64 TOPO  7000        2000       128000      7000        RR  RL  LR  LL   
   10        64 TOPO  7000        2000         128000      RR  RL  LR  LL   
   11        64 TOPO  7128        2000       128000      7128        RR  RL  LR  LL   
   11        64 TOPO  7128        2000         128000      RR  RL  LR  LL   
   12        64 TOPO  7256        2000       128000      7256        RR  RL  LR  LL   
   12        64 TOPO  7256        2000         128000      RR  RL  LR  LL   
   13        64 TOPO  7384        2000       128000      7384        RR  RL  LR  LL   
   13        64 TOPO  7384        2000         128000      RR  RL  LR  LL   
Sources: 42
<snip>
  ID  Name        SpwId RestFreq(MHz)  SysVel(km/s)
  0    J0925+0019  0    -              -           
  0    J0925+0019  1    -              -           
  0    J0925+0019  2    -              -           
  0    J0925+0019  3    -              -           
  0    J0925+0019  4    -              -           
  0    J0925+0019  5    -              -           
  0    J0925+0019  6    -              -           
  0    J0925+0019  7    -              -           
  0    J0925+0019  8    -              -           
  0    J0925+0019  9    -              -           
  0    J0925+0019  10    -              -           
  0    J0925+0019  11    -              -           
  0    J0925+0019  12    -              -           
  0    J0925+0019  13    -              -           
  1    SN2010FZ    0    -              -           
  1    SN2010FZ    1    -              -           
  1    SN2010FZ    2    -              -           
  1    SN2010FZ    3    -              -           
  1    SN2010FZ    4    -              -           
  1    SN2010FZ    5    -              -           
  1    SN2010FZ    6    -              -           
  1    SN2010FZ    7    -              -           
  1    SN2010FZ    8    -              -           
  1    SN2010FZ    9    -              -           
  1    SN2010FZ    10    -              -           
  1    SN2010FZ    11    -              -           
  1    SN2010FZ    12    -              -           
  1    SN2010FZ    13    -              -           
  2    3C286        0    -              -           
  2    3C286        1    -              -           
  2    3C286        2    -              -           
  2    3C286        3    -              -           
  2    3C286        4    -              -           
  2    3C286        5    -              -           
  2    3C286        6    -              -           
  2    3C286        7    -              -           
  2    3C286        8    -              -           
  2    3C286        9    -              -           
  2    3C286        10    -              -           
  2    3C286        11    -              -           
  2    3C286        12    -              -           
  2    3C286        13    -              -           
Antennas: 27:
  ID  Name  Station  Diam.    Long.        Lat.       
  0    ea01  W09      25.0 m  -107.37.25.2  +33.53.51.0 
  1    ea02  E02      25.0 m  -107.37.04.4  +33.54.01.1 
  2    ea03  E09      25.0 m  -107.36.45.1  +33.53.53.6 
  3    ea04  W01      25.0 m  -107.37.05.9  +33.54.00.5 
  4    ea05  W08      25.0 m  -107.37.21.6  +33.53.53.0 
  5    ea06  N06      25.0 m  -107.37.06.9  +33.54.10.3 
  6    ea08  N01      25.0 m  -107.37.06.0  +33.54.01.8 
  7    ea09  E06      25.0 m  -107.36.55.6  +33.53.57.7 
  8    ea10  N03      25.0 m  -107.37.06.3  +33.54.04.8 
  9    ea11  E04      25.0 m  -107.37.00.8  +33.53.59.7 
  10  ea12  E08      25.0 m  -107.36.48.9  +33.53.55.1 
  11  ea13  N07      25.0 m  -107.37.07.2  +33.54.12.9 
  12  ea14  E05      25.0 m  -107.36.58.4  +33.53.58.8 
  13  ea15  W06      25.0 m  -107.37.15.6  +33.53.56.4 
  14  ea16  W02      25.0 m  -107.37.07.5  +33.54.00.9 
  15  ea17  W07      25.0 m  -107.37.18.4  +33.53.54.8 
  16  ea18  N09      25.0 m  -107.37.07.8  +33.54.19.0 
  17  ea19  W04      25.0 m  -107.37.10.8  +33.53.59.1 
  18  ea20  N05      25.0 m  -107.37.06.7  +33.54.08.0 
  19  ea21  E01      25.0 m  -107.37.05.7  +33.53.59.2 
  20  ea22  N04      25.0 m  -107.37.06.5  +33.54.06.1 
  21  ea23  E07      25.0 m  -107.36.52.4  +33.53.56.5 
  22  ea24  W05      25.0 m  -107.37.13.0  +33.53.57.8 
  23  ea25  N02      25.0 m  -107.37.06.2  +33.54.03.5 
  24  ea26  W03      25.0 m  -107.37.08.9  +33.54.00.1 
  25  ea27  E03      25.0 m  -107.37.02.8  +33.54.00.5 
  26  ea28  N08      25.0 m  -107.37.07.5  +33.54.15.8 
</pre>
</pre>
Note that the spws are re-numbered to 0-13.
Note that the spectral windows are re-numbered to 0 through 13.
 
Prepare the MS for calibration by adding the "scratch columns" which will contain the model (MODEL_DATA) and the calibrated data (CORRECTED_DATA). This is done by {{clearcal}}, which will create the columns if they don't already exist, and initialize their values to be equal to those of the raw data (DATA).


Prepare the MS for calibration by adding scratch columns. This will take a few minutes.
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 545: Line 505:
=== Setting the flux density scale ===
=== Setting the flux density scale ===


Before calibrating, we put a model for flux calibration source 3C286 into the MS (in the MODEL_DATA column we just created).
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. 
Have it set the flux on a per-channel basis.
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 .
NOTE: This uses the AOC Unix location for casapy models (yours may be different):
 
Before calibrating, we insert a model for flux calibration source 3C286 into the MS (in the MODEL_DATA column we just created). 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:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
setjy(vis='SN2010FZ_flagged10s.ms',field='2',spw='',scalebychan=True, \
setjy(vis='SN2010FZ_flagged10s.ms', listmodimages=True)
      modimage='/usr/lib64/casapy/data/nrao/VLA/CalModels/3C286_C.im')
</source>
</source>
It reports to logger that its about 7.7Jy at lower end to 5.7Jy at upper frequency limit.
 
The relevant image for our purposes is <tt>3C286_C.im</tt>, in the directory <tt>/usr/local/casapy-3.3.0/data/nrao/VLA/CalModels</tt>.  Your system may vary.
 
<source lang="python">
# In CASA
setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, \
      modimage='/usr/local/casapy-3.3.0/data/nrao/VLA/CalModels/3C286_C.im')
</source>
 
* scalebychan=True: will fill the model with per-channel values; otherwise, {{setjy}} would use a single value per spectral window.
 
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.


=== Calibrating delays and bandpass ===
=== Calibrating delays and bandpass ===
Line 563: Line 535:
         gaintype='G',refant='ea02',calmode='p',solint='int',minsnr=3)  
         gaintype='G',refant='ea02',calmode='p',solint='int',minsnr=3)  
</source>
</source>
* solint='int': do a per-integration solve (every 10 seconds, since we've time-averaged the data)
* minsnr=3: apply a minimum signal-to-noise cutoff.  Solutions with less than this value will be flagged.


[[Image:plotSN2010FZ_plotcal_G0p1.png|200px|thumb|right|plotcal G0 phase ant 0~15]]
[[Image:plotSN2010FZ_plotcal_G0p1.png|200px|thumb|right|plotcal G0 phase ant 0~15]]
[[Image:plotSN2010FZ_plotcal_G0p2.png|200px|thumb|right|plotcal G0 phase ant 16~26]]
[[Image:plotSN2010FZ_plotcal_G0p2.png|200px|thumb|right|plotcal G0 phase ant 16~26]]
Plot the phase solutions (using full phase range instead of autorange)
 
Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 572: Line 549:
         plotrange=[-1,-1,-180,180])
         plotrange=[-1,-1,-180,180])
</source>
</source>
Step through the antenna-based solutions.  They look good (and fairly flat over the scans).
Step through the antenna-based solutions.  They look good (and fairly flat over the scans).
NOTE: If you want to make single-page multipanel plots (like those shown to the right), particularly for
NOTE: 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:
hardcopy (where it only shows the first page), you can do:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 588: Line 567:


We can now solve for the residual antenna-based delays that we saw in phase vs. frequency.
We can now solve for the residual antenna-based delays that we saw in phase vs. frequency.
This uses the gaintype='K' option in gaincal (this is not documented in earlier releases, but is available in
This uses the new gaintype='K' option in gaincal. Note that this currently does not do a "global fringe-fitting" solution for delays,
Version 3.2.1 and later). Note that this currently does not do a "global fringe-fitting" solution for delays,
but instead does a baseline-based delay solution to all baselines to the refant, treating these
but instead does a baseline-based delay solution to all baselines to the refant, treating these
as antenna-based delays.  In most cases with high-enough S/N to get baseline-based delay solutions
as antenna-based delays.  In most cases with high-enough S/N to get baseline-based delay solutions
this will suffice. We avoid the beginning of spw 0 due to the extreme roll-off (with loss of S/N) at the
this will suffice. We avoid the beginning of spw 0 due to the extreme roll-off (with loss of S/N) at the
starting edge.
starting edge.
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 601: Line 580:
</source>
</source>
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.
We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration.
The delays found are sent to the terminal. They are up to a few nanoseconds.
We can plot the delays, as a function of time (note that the units on the y-axis are nanoseconds):
 
<source lang="python">
# In CASA
plotcal(caltable='calSN2010FZ.K0', xaxis='time', yaxis='real')
</source>
 
The delays range from around -6 to 6 nanoseconds.


[[Image:plotSN2010FZ_plotcal_B0ea14.png|200px|thumb|right|plotcal B0 amp phase vs. freq for ea01]]
Now solve for the bandpass using the previous tables:
Now solve for the bandpass using the previous tables:
<source lang="python">
<source lang="python">
Line 633: Line 618:
(e.g. ea14,ea16,ea17,ea25).
(e.g. ea14,ea16,ea17,ea25).
To plot amp and phase for a single antenna versus frequency (see plots at right):
To plot amp and phase for a single antenna versus frequency (see plots at right):
[[Image:plotSN2010FZ_plotcal_B0ea14.png|200px|thumb|right|plotcal B0 amp and phase vs. freq for ea14]]
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp', \
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp', \
         antenna='ea14',subplot=211,figfile='')
         antenna='ea14',subplot=211)
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase', \
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase', \
         antenna='ea14',subplot=212,plotrange=[-1,-1,-180,180], \
         antenna='ea14',subplot=212,plotrange=[-1,-1,-180,180])
        figfile='plotSN2010FZ_plotcal_B0ea14.png')
</source>
</source>


Line 647: Line 634:
as the bandpass calibrator, then you would need to follow this bandpass with a second one on a source of known spectrum
as the bandpass calibrator, then you would need to follow this bandpass with a second one on a source of known spectrum
in order to take out the spurious bandpass slope introduced by the (unknown) intrinsic spectral shape of your calibrator.
in order to take out the spurious bandpass slope introduced by the (unknown) intrinsic spectral shape of your calibrator.
Running {{bandpass} with <tt>bandtype='BPOLY'</tt> and <tt>degamp=1</tt> should suffice to take out a slope albeit on a
 
per-antenna basis rather than over all the array.  This should work as long as you have enough S/N on your flux calibrator
Running {{bandpass}} with <tt>bandtype='BPOLY'</tt> and <tt>degamp=1</tt> should suffice to take out a slope, albeit on a per-antenna basis rather than over the entire array.  This should work as long as you have enough S/N on your flux calibrator to solve for two polynomial orders (might be hard if you are using very narrow bands at high frequency).
to solve for two polynomial orders (might be hard if you are using very narrow bands at high frequency).


=== Final phase and amplitude calibration ===
=== Final phase and amplitude calibration ===
Line 655: Line 641:
[[Image:plotSN2010FZ_plotcal_G1p1.png|200px|thumb|right|plotcal G1 phase ant 0~15]]
[[Image:plotSN2010FZ_plotcal_G1p1.png|200px|thumb|right|plotcal G1 phase ant 0~15]]
[[Image:plotSN2010FZ_plotcal_G1p2.png|200px|thumb|right|plotcal G1 phase ant 16~26]]
[[Image:plotSN2010FZ_plotcal_G1p2.png|200px|thumb|right|plotcal G1 phase ant 16~26]]
Now calibrate phases for real with wider bandwidth. First the flux calibrator again, with a per-integration solution time:
 
Now calibrate phases using the full bandwidth. First the flux calibrator again, with a per-integration solution time:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 663: Line 651:
         solint='int',gaintype='G',calmode='p')
         solint='int',gaintype='G',calmode='p')
</source>
</source>
Next our phase calibrator, appending these solutions to previous table.
Next our phase calibrator, appending these solutions to previous table.
Exclude RFI channels here, and obtain one solution per scan:
Exclude RFI channels here, and obtain one solution per scan (since this is a fainter source):
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 673: Line 663:
         solint='inf',gaintype='G',calmode='p',append=True)
         solint='inf',gaintype='G',calmode='p',append=True)
</source>
</source>
The phases look reasonably connected:
The phases look reasonably connected:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 681: Line 673:


NOTE: If there were significant phase variations then you would also do short-timescale phase solutions on
NOTE: If there were significant phase variations then you would also do short-timescale phase solutions on
the gain calibrator (field 0), as we did for 3C286, that you would apply only to that calibrator in order to get the amplitude  
the gain calibrator (field 0), as we did for 3C286, that you would apply only to that calibrator in order to get the amplitude solutions correct.  You would still apply the per-scan phases to the target.  Because we have good phase stability we will only do per-scan phase solutions on J0925+0019 and use that in both the amplitude solutions and to correct the target phases.
solutions correct.  You would still apply the per-scan phases to the target.  Because we have good phase stability
 
we will only do per-scan phase solutions on J0925+0019 and use that in both the amplitude solutions and to correct the target
Now solve for amplitudes on a per scan interval. Do these separately using <tt>gainfield</tt> so phases don't get
phases.
transferred across fields. Note that {{gaincal}} uses linear interpolation of the previously determined phases by default.  Pre-apply the gaincurve as well:


Now solve for amplitudes on a per scan interval. Do these separately using gainfield so phases don't get
transferred across fields. Uses linear interpolation of the previously determined phases by default.
Pre-apply the gaincurve also:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 706: Line 695:
[[Image:plotSN2010FZ_plotcal_F2a1.png|200px|thumb|right|plotcal F2 amp ant 0~15]]
[[Image:plotSN2010FZ_plotcal_F2a1.png|200px|thumb|right|plotcal F2 amp ant 0~15]]
[[Image:plotSN2010FZ_plotcal_F2a2.png|200px|thumb|right|plotcal F2 amp ant 16~26]]
[[Image:plotSN2010FZ_plotcal_F2a2.png|200px|thumb|right|plotcal F2 amp ant 16~26]]
Since the flux on the gain calibrator is not scaled to its correct flux (but to 1.0Jy)
 
use fluxscale to transfer the amplitude gains from 3c286:
Since the flux on the gain calibrator is not scaled to its correct flux (but to 1.0 Jy by default),
use {{fluxscale}} to transfer the amplitude gains from 3c286:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 713: Line 704:
           fluxtable='calSN2010FZ.F2',reference='2',transfer='0')
           fluxtable='calSN2010FZ.F2',reference='2',transfer='0')
</source>
</source>
The logger output gives:
The logger output gives:
<pre>
<pre>
Found reference field(s): 3C286
Found reference field(s): 3C286
Found transfer field(s):  J0925+0019
Found transfer field(s):  J0925+0019
Flux density for J0925+0019 in SpW=0 is: 0.976065 +/- 0.000880351 (SNR = 1108.72, nAnt= 25)
Flux density for J0925+0019 in SpW=0 is: 0.976619 +/- 0.00285581 (SNR = 341.976, N= 50)
Flux density for J0925+0019 in SpW=1 is: 0.97776 +/- 0.000811257 (SNR = 1205.24, nAnt= 25)
Flux density for J0925+0019 in SpW=1 is: 0.978306 +/- 0.00262726 (SNR = 372.367, N= 50)
Flux density for J0925+0019 in SpW=2 is: 0.979643 +/- 0.00069687 (SNR = 1405.78, nAnt= 25)
Flux density for J0925+0019 in SpW=2 is: 0.980252 +/- 0.00252457 (SNR = 388.285, N= 50)
Flux density for J0925+0019 in SpW=3 is: 0.980233 +/- 0.000838793 (SNR = 1168.62, nAnt= 25)
Flux density for J0925+0019 in SpW=3 is: 0.981104 +/- 0.0025413 (SNR = 386.064, N= 50)
Flux density for J0925+0019 in SpW=4 is: 0.981888 +/- 0.000689379 (SNR = 1424.31, nAnt= 25)
Flux density for J0925+0019 in SpW=4 is: 0.982537 +/- 0.00232622 (SNR = 422.375, N= 50)
Flux density for J0925+0019 in SpW=5 is: 0.982243 +/- 0.000813425 (SNR = 1207.54, nAnt= 21)
Flux density for J0925+0019 in SpW=5 is: 0.986066 +/- 0.00308253 (SNR = 319.889, N= 50)
Flux density for J0925+0019 in SpW=6 is: 0.981002 +/- 0.000894034 (SNR = 1097.27, nAnt= 21)
Flux density for J0925+0019 in SpW=6 is: 0.988012 +/- 0.00355626 (SNR = 277.823, N= 50)
Flux density for J0925+0019 in SpW=7 is: 0.98006 +/- 0.000672249 (SNR = 1457.88, nAnt= 21)
Flux density for J0925+0019 in SpW=7 is: 0.98155 +/- 0.00224373 (SNR = 437.464, N= 50)
Flux density for J0925+0019 in SpW=8 is: 0.960763 +/- 0.000715631 (SNR = 1342.54, nAnt= 24)
Flux density for J0925+0019 in SpW=8 is: 0.962152 +/- 0.00302232 (SNR = 318.349, N= 48)
Flux density for J0925+0019 in SpW=9 is: 0.957227 +/- 0.000781501 (SNR = 1224.86, nAnt= 24)
Flux density for J0925+0019 in SpW=9 is: 0.958591 +/- 0.00304029 (SNR = 315.296, N= 48)
Flux density for J0925+0019 in SpW=10 is: 0.955039 +/- 0.000774128 (SNR = 1233.7, nAnt= 24)
Flux density for J0925+0019 in SpW=10 is: 0.956297 +/- 0.0031889 (SNR = 299.883, N= 48)
Flux density for J0925+0019 in SpW=11 is: 0.953599 +/- 0.000944027 (SNR = 1010.14, nAnt= 24)
Flux density for J0925+0019 in SpW=11 is: 0.95489 +/- 0.00389993 (SNR = 244.848, N= 48)
Flux density for J0925+0019 in SpW=12 is: 0.950831 +/- 0.000933345 (SNR = 1018.73, nAnt= 24)
Flux density for J0925+0019 in SpW=12 is: 0.952233 +/- 0.00426962 (SNR = 223.025, N= 48)
Flux density for J0925+0019 in SpW=13 is: 0.946425 +/- 0.00101842 (SNR = 929.306, nAnt= 24)
Flux density for J0925+0019 in SpW=13 is: 0.947977 +/- 0.00426486 (SNR = 222.276, N= 48)
</pre>
</pre>
You may see slightly different numbers on your machine.
 
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, the number of polarizations is 2 (RR and LL).


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 5 then falls again.
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 5 then falls again.
Line 741: Line 734:
plotcal(caltable='calSN2010FZ.F2',xaxis='time',yaxis='amp',iteration='antenna')
plotcal(caltable='calSN2010FZ.F2',xaxis='time',yaxis='amp',iteration='antenna')
</source>
</source>
The gains on 3C286 are about 1 (the bandpass solution on 3C286 has absorbed the calibration from counts to Jy) but  
The gains on 3C286 are about 1 (the bandpass solution on 3C286 has absorbed the calibration from counts to Jy) but  
fluxscale has adjusted the per-spw scale on J0925+0019 to get its correct spectrum rather than the assumed 1 Jy
{{fluxscale}} has adjusted the per-spw scale on J0925+0019 to get its correct spectrum rather than the assumed 1 Jy
flat spectrum.
flat spectrum.


== Applying the Calibration and Final Editing ==
== Applying the Calibration, Final Editing, and a Quick Recalibration ==


Next we actually apply all our accumulated calibration tables. We apply these to the  
Next we actually apply all our accumulated calibration tables. We apply these to the  
Line 779: Line 773:
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
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:
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:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 788: Line 782:
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
You can exclude this through antenna negation:
You can exclude this through antenna negation:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 796: Line 792:
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
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.
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.
Exclude these and replot:
Exclude these and replot:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 823: Line 821:
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
Looks good. If we were more diligent we would go back and recalibrate, but this looks good enough for now.
 
Looks pretty good.


Plot the phase:
Plot the phase:
Line 835: Line 834:
Note the characteristic "bowtie" pattern of the phases about the sub-band centers.
Note the characteristic "bowtie" pattern of the phases about the sub-band centers.
Here we can see the effect of the EVLA "delay clunking", where the delay steps through discrete values such that
Here we can see the effect of the EVLA "delay clunking", where the delay steps through discrete values such that
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  
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).
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 target source in any event.


Now lets plot the corrected data amplitude for the phase calibrator (field 0):
Now let's plot the corrected data amplitude for the phase calibrator (field 0):
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 847: Line 845:
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_amp.png|200px|thumb|right|plotms cal applied flagged fld0 amp]]
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_amp.png|200px|thumb|right|plotms cal applied flagged fld0 amp]]
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phase.png|200px|thumb|right|plotms cal applied flagged fld0 phase]]
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phase.png|200px|thumb|right|plotms cal applied flagged fld0 phase]]
You can see the roll-off pumping up noise at the baseband edges (about 8-16 channels worth). Also, we can see some RFI we missed:
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:
* <6804MHz spw  8 below ch 30 lots of bad stuff (alot from ea18,ea22 but others too)
* <6804 MHz spw  8 below ch 30 lots of bad stuff (a lot from ea18,ea22 but others too)
7168MHz spw 11 ch 20
7168 MHz spw 11 ch 20
*  pretty much all of spw 12,13
*  pretty much all of spw 12,13
The ch 20 ones are all harmonics of the notorious 128MHz tone. NOTE: You can get the frequency of a RFI feature by looking at
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.
the logger report from using the '''Locate''' [[File:casaplotms-locate-tool.png]] tool.
 
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:


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:
<pre>
<pre>
spw = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'
spw = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'
</pre>
</pre>
Without further flagging, it may be best to drop spw 12-13 for imaging (we will do so from now on).
Without further flagging, it may be best to drop spw 12-13 for imaging (we will do so from now on).


Line 865: Line 863:
# In CASA
# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       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', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
Looks better.
Looks better.
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_ampavg.png|200px|thumb|right|plotms cal applied flagged fld0 amp averaged]]
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_ampavg.png|200px|thumb|right|plotms cal applied flagged fld0 amp averaged]]
Now plot amplitudes for the corrected data averaged over baseline to see the source spectrum
 
Now plot amplitudes for the corrected data averaged over baseline to see the source spectrum:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 878: Line 880:
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
The last two sub-bands spw 12-13 give reasonable values, with only a tiny offset from spw 8-11.
The last two sub-bands spw 12-13 give reasonable values, with only a tiny offset from spw 8-11.
There are also strange amplitude excursions, particularly in the low end of the first baseband.  These must be coming
There are also strange amplitude excursions, particularly in the low end of the first baseband.  These must be coming
from one or more scans.  You can iterate over scan to see the strange amplitudes (mostly in first scan):
from one or more scans.  You can iterate over scan to see the strange amplitudes (mostly from scan 7):
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 888: Line 892:
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
If we were interested in imaging the calibrator we would try to flag or fix this, but it shouldn't affect the
calibration transfer to our target very much (we did not see anomalous solutions in that first scan). 


We can also plot the corrected phase - looks fairly good
Also, there is something odd with the amplitudes for spw 5-6, perhaps due to the problem with baseline ea17&ea25 (which we flagged, but didn't recalibrate afterward).  This is troubling enough that we will quickly go through a second round of calibration.  We may as well flag scan 7 first, as well:
 
<source lang="python">
# In CASA
flagdata(vis='SN2010FZ_flagged10s.ms', scan='7', flagbackup=False)
#
clearcal('SN2010FZ_flagged10s.ms')
#
chanStr = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'
#
setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, \
      modimage='/usr/local/casapy-3.3.0/data/nrao/VLA/CalModels/3C286_C.im')
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G0.2',field='2',spw=chanStr, \
        gaintype='G',refant='ea02',calmode='p',solint='int',minsnr=3)
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.K0.2',gaintable='calSN2010FZ.G0.2', \
        field='2', spw=chanStr, gaintype='K', \
        refant='ea02', combine='scan', solint='inf', minsnr=3)
#
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0.2', \
        gaintable=['calSN2010FZ.G0.2','calSN2010FZ.K0.2'], \
        field='2',refant='ea02',solnorm=False, \
        spw=chanStr,
        bandtype='B', combine='scan', solint='inf', gaincurve=True)
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2'], \
        field='2',refant='ea02',solnorm=F, spw=chanStr, \
        solint='int',gaintype='G',calmode='p')
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2',
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2'], \
        field='0',refant='ea02',solnorm=F, \
        spw=chanStr, \
        solint='inf',gaintype='G',calmode='p',append=True)
#
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2'], \
        gainfield=['2','2','2'], field='2',refant='ea02',solnorm=F,
        spw=chanStr, \
        solint='inf',gaintype='G',calmode='a',gaincurve=True)
#
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2'],\
        gainfield=['2','2','0'], field='0',refant='ea02',solnorm=F, \
        spw=chanStr, \
        solint='inf',gaintype='G',calmode='a',gaincurve=True,append=True)
#
fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G2.2', \
          fluxtable='calSN2010FZ.F2.2',reference='2',transfer='0')
#
applycal(vis='SN2010FZ_flagged10s.ms',field='2', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2','calSN2010FZ.F2.2'], \
        gainfield=['','','2','2'],interp=['nearest','nearest','linear','nearest'], \
        parang=False,calwt=F,gaincurve=T)
#
applycal(vis='SN2010FZ_flagged10s.ms',field='0', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2','calSN2010FZ.F2.2'], \
        gainfield=['','','0','0'], interp=['nearest','nearest','nearest','nearest'], \
        parang=False,calwt=F,gaincurve=T)
#
applycal(vis='SN2010FZ_flagged10s.ms',field='1', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2','calSN2010FZ.F2.2'], \
        gainfield=['','','0','0'], interp=['nearest','nearest','linear','linear'], \
        parang=False,calwt=F,gaincurve=T)
#
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
      spw=chanStr, \
      correlation='RR,LL',avgbaseline=True,avgtime='60000s',
      xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
 
Note that we have set the variable <tt>chanStr</tt> for our channel selection; this makes the task commands shorter and easier to read.
 
The source spectrum plot now looks much better:
 
[[Image:plotSN2010FZ_plotms_reproc_fld0_ampavg.png|200px|thumb|right|plotms cal applied flagged fld0 amp averaged]]
<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       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', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
      correlation='RR,LL',avgbaseline=True,avgtime='60000s',
      xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
 
We can also plot the corrected phase - looks good:
<source lang="python">
# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
      spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')
       correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')
</source>
</source>
Line 903: Line 991:
# In CASA
# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       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', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',avgbaseline=True,avgtime='600s',
       correlation='RR,LL',avgbaseline=True,avgtime='600s',
       xaxis='frequency',yaxis='phase',ydatacolumn='corrected')
       xaxis='frequency',yaxis='phase',ydatacolumn='corrected')
</source>
</source>
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phaseavg.png|200px|thumb|right|plotms cal applied flagged fld0 phase averaged]]
[[Image:plotSN2010FZ_plotms_appliedflags_fld0_phaseavg.png|200px|thumb|right|plotms cal applied flagged fld0 phase averaged]]
In this case we can see the residual effect of the EVLA "delay clunking" described above. It is reduced due to the averaging
that we applied, but it is still there.


[[Image:plotSN2010FZ_plotms_appliedflags_fld1.png|200px|thumb|right|plotms cal applied flagged fld1 amp averaged]]
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.
You can look at the target source field='1' but there are lots of data so you will need to do alot of averaging.
 
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.
For example:
For example:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 920: Line 1,008:
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
</source>
</source>
Alas, the upper baseband still has lots of low level RFI.
Alas, the upper baseband still has lots of low level RFI.


Now split off the data for calibrators and target, to avoid later issues that can corrupt the MSes.
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.
These will take a bit of time...field 1 took 18min on my workstation.
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_split10s.ms',datacolumn='corrected',field='1')
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_split10s.ms', \
      datacolumn='corrected',field='1',spw='0~11')
#
#
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_3c28610s.ms',datacolumn='corrected',field='2')
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_3c28610s.ms', \
      datacolumn='corrected',field='2',spw='0~11')
#
#
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_J092510s.ms',datacolumn='corrected',field='0')
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_J092510s.ms', \
      datacolumn='corrected',field='0',spw='0~11')
</source>
</source>


== Imaging ==
== Imaging ==


This is D-config data at C-band, look at the Obs Status Summary:
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]:
[http://evlaguides.nrao.edu/index.php?title=Observational_Status_Summary_-_Current]
 
Synthesized beam should be 12" at 6GHz with primary beam FOV 7.5arcmin (450").
* Synthesized beam should be 12" at 6 GHz with primary beam field of view of 7.5 arcmin (450")
Our data spans 4.5-7.5GHz : beam 9.6 at 7.5GHz and FOV 10' at 4.5GHz
 
A cellsize of 3" should work, with an imsize > 200 to cover 2xFWHM FOV
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.  We want to subsample the synthesized beam by a factor of ~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.
An imsize of 400+ will put the main beam inside the inner quarter safely
The Briggs robust (0.5) weighting is somewhere between uniform and natural
and will give reasonable resolution but still see some larger scale structure.


Due to the numerology of FFTW (which clean uses underneath for FFTs) optimal sizes,  
We will also use the Briggs robust (with <tt>robust=0.5</tt>) weighting, which is a compromise between uniform and natural weighting,
imsize should be composite number with two and only two prime factors chosen from
and will give reasonable resolution but will allow us to still see larger scale structure.
2,3,5.  Taking into account the x1.2 padding that clean uses internally to the imsize
 
you give it (and 1.2=2*3/5), we choose 640 or 1280 as our imsize (640=2^7*5). Other
Due to the numerology of [http://www.fftw.org/ FFTW's] (which {{clean}} uses under the hood for FFTs) optimal sizes,  
reasonable sets would be 405,1215,etc. (405=3^4*5) or 432,648,1296 (these are 2^n*3^m*5).
<tt>imsize</tt> should be composite number with two and only two prime factors chosen from
2, 3, and 5.  Taking into account the x1.2 padding that clean uses internally to the imsize
you give it (and 1.2 = 2*3/5), we choose 640 or 1280 as our imsize (640 = 2^7*5). Other
reasonable sets would be 405, 1215, etc. (405 = 3^4*5) or 432, 648, 1296 (these are 2^n*3^m*5).
In practice, if you give it non-optimal values for imsize, you may find that the transforms
In practice, if you give it non-optimal values for imsize, you may find that the transforms
take a bit longer, which is noticeable if you are doing interactive clean.
take a bit longer, which is noticeable if you are doing interactive clean.
Line 955: Line 1,047:
into major cycles going back to data residuals, it just does cleaning in a bunch of minor
into major cycles going back to data residuals, it just does cleaning in a bunch of minor
cycles in the image plane.  This can give much poorer imaging quality in cases with poor
cycles in the image plane.  This can give much poorer imaging quality in cases with poor
psf (snapshots) or in the case of complex emission structure (like ours) - clean tends to
uv coverage (snapshots) or in the case of complex emission structure (like ours) -- clean tends to
diverge in this case.  You should explicitly set <tt>imagermode='csclean'</tt> in your
diverge in this case.  You should explicitly set <tt>imagermode='csclean'</tt> in your
call to clean.  Also, in our case the psf is very good using mfs, so by default it will not
call to clean.  Also, in our case the psf is very good using mfs, so by default it will not
Line 970: Line 1,062:


NOTE: If you are pressed for time, then you might want to jump ahead to
NOTE: If you are pressed for time, then you might want to jump ahead to
[[EVLA_6cmWideband_Tutorial_SN2010FZ#Cleaning_the_lower_baseband_using_two_MFS_Taylor_terms]]  
[[EVLA_6-cm_Wideband_Tutorial_SN2010FZ_(Caltech)#Cleaning_the_lower_baseband_using_two_MFS_Taylor_terms]]  
and while it is cleaning you can read the other Imaging descriptions.
and while it is cleaning you can read the other Imaging descriptions.


Line 978: Line 1,070:
NOTE: this first time will take a few minutes at start to create scratch columns
NOTE: this first time will take a few minutes at start to create scratch columns
in the MS in case we want to do self-calibration later.
in the MS in case we want to do self-calibration later.
'''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.'''


[[Image:viewSN2010FZ_spw5_clean640.png|200px|thumb|right|clean spw5 640x640]]
[[Image:viewSN2010FZ_spw5_clean640.png|200px|thumb|right|clean spw5 640x640]]
Line 992: Line 1,086:
       weighting='briggs',robust=0.5,calready=True,interactive=True)
       weighting='briggs',robust=0.5,calready=True,interactive=True)
</source>
</source>
Start carefully by boxing the bright source and setting iterations to 10 at first
 
Gradually add more boxes and increase the number of iterations
* Start carefully by boxing the bright source and setting iterations to 10 at first
Since this is not much more than a snapshot you see the six-fold sidelobe pattern
* Gradually add more boxes and increase the number of iterations
* Since this is not much more than a snapshot you see the six-fold sidelobe pattern
of the extended emission in the center of the map. This decreases as you clean
of the extended emission in the center of the map. This decreases as you clean
out this emission.
out this emission.
Stop cleaning when the residuals look like noise (and you cannot clearly see sources).
* Stop cleaning when the residuals look like noise (and you cannot clearly see sources).
To stop click the red X button.
* To stop, click the red [[File:clean-stop.png]] button.


The top figure to the right shows a zoom in on the end state of the clean, where
The top figure to the right shows a zoom in on the end state of the clean, where
we have marked a number of boxes and cleaned them out.
we have marked a number of boxes and cleaned them out.


Note that there are some strange sidelobe patterns in lower left, possibly
Note that there are some strange sidelobe patterns in lower left, possibly  
from a source outside the image area.  We can make a bigger image starting from
from a source outside the image area.  We can make a bigger image starting from
our current model:
our current model:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,016: Line 1,112:
       weighting='briggs',robust=0.5,calready=True,interactive=True)
       weighting='briggs',robust=0.5,calready=True,interactive=True)
</source>
</source>
Sure enough, there is a bright source near the lower left (see middle panel at right).  
Sure enough, there is a bright source near the lower left (see middle panel at right).  
Box it, clean it a bit, and look again.  There is a second source in the mid-left (track
Box it, clean it a bit, and look again.  There is a second source in the mid-left (track
Line 1,021: Line 1,118:


You can use the CASA {{viewer}} to display the images that {{clean}} creates.  If you need more guidance
You can use the CASA {{viewer}} to display the images that {{clean}} creates.  If you need more guidance
on using the viewer, see the [[http://casa.nrao.edu/CasaViewerDemo/casaViewerDemo.html CASAViewerDemo]] video. For now just bring up your restored image
on using the viewer, see the [http://casa.nrao.edu/CasaViewerDemo/casaViewerDemo.html CASA Viewer Demo] video. For now, just bring up your restored image directly:
directly:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
viewer('imgSN2010FZ10s_spw5_clean1280.image')
viewer('imgSN2010FZ10s_spw5_clean1280.image')
</source>
</source>
The restored image is shown in bottom panel to the right.  I have chosen the Grayscale1 instead of default color
 
map as I prefer grayscale to false color for assessing image quality.
The restored image is shown in the bottom panel to the right.  I have chosen the Grayscale1 instead of default color
map as I prefer grayscale to false color for assessing image quality. Also, you can change the scaling of the image using the "scaling power cycles" slider under "basic settings".
 
Check the rms of the residuals using the {{imstat}} task:
Check the rms of the residuals using the {{imstat}} task:
<source lang="python">
<source lang="python">
Line 1,035: Line 1,134:
print 'Residual standard deviation = '+str(mystat['sigma'][0])
print 'Residual standard deviation = '+str(mystat['sigma'][0])
</source>
</source>
I got 31.8uJy for mine.
In this particular case, it's 31.8 uJy; yours will likely be slightly different.


=== Cleaning the lower baseband ===
=== Cleaning the lower baseband ===
Line 1,042: Line 1,141:
Now, image the entire lower baseband (spw 0-7).
Now, image the entire lower baseband (spw 0-7).
Follow same iterative procedure as before, and get the best
Follow same iterative procedure as before, and get the best
residuals you can.  Because of the bandwidth and frequency
residuals you can without "cleaning the noise".   
synthesis, the sidelobe pattern is different than before and
 
it is much easier to see fainter emission.
* Because of the bandwidth and frequency synthesis, the sidelobe pattern is different than before and it is much easier to see fainter emission.
Be careful cleaning sources that lie near or on sidelobe splotches.
* Be careful cleaning sources that lie near or on sidelobe splotches.
Clean the central emission region way down first to reduce the sidelobe
* Clean the central emission region way down first to reduce the sidelobe level before adding components in the sidelobe areas.
level before adding components in the sidelobe areas.
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,060: Line 1,159:
print 'Residual standard deviation = '+str(mystat['sigma'][0])
print 'Residual standard deviation = '+str(mystat['sigma'][0])
</source>
</source>
I got 11.3uJy (and there is clearly structure left in the residual). To the right is a zoom-in on the center
 
of the restored image.
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.


==== Cleaning the lower baseband using two MFS Taylor terms ====
==== Cleaning the lower baseband using two MFS Taylor terms ====
Line 1,067: Line 1,166:
The mfs nterms=2 option creates two "Taylor Term" images - an average intensity image (with suffix <tt>.image.tt0</tt>)  
The mfs nterms=2 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 spectral index).
and a spectral slope image (with suffix <tt>.image.tt1</tt>) which is intensity x alpha (where alpha is spectral index).
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
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
reffreq parameter in clean). The convention for spectral index alpha is that


<math>
<math>
Line 1,077: Line 1,175:


[[Image:viewSN2010FZ_spw0to7_mfs2clean.png|200px|thumb|right|clean spw0-7 mfs nterms=2 in progress]]
[[Image:viewSN2010FZ_spw0to7_mfs2clean.png|200px|thumb|right|clean spw0-7 mfs nterms=2 in progress]]
[[Image:viewSN2010FZ_spw0to7_mfs2loadalpha.png|200px|thumb|right|clean spw0-7 mfs nterms=2 load alpha with LEL]]
[[Image:viewSN2010FZ_spw0to7_mfs2panelalpha.png|200px|thumb|right|clean spw0-7 mfs nterms=2 tt0 and alpha]]
[[Image:viewSN2010FZ_spw0to7_mfs2panelalpha.png|200px|thumb|right|clean spw0-7 mfs nterms=2 tt0 and alpha]]
Lets try using multi-frequency synthesis with nterms=2 on the lower baseband.
Let's try using multi-frequency synthesis with nterms=2 on the lower baseband.
The dirty beam will have lower sidelobes so we turn up cyclefactor for csclean a bit:
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:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,093: Line 1,191:
print 'Residual standard deviation = '+str(mystat['sigma'][0])
print 'Residual standard deviation = '+str(mystat['sigma'][0])
</source>
</source>
I got 10.5uJy (somewhat better looking than the nterms=1).
 
For this run, the rms is 10.5 uJy (somewhat better-looking than the nterms=1).
The top screenshot to the right shows an intermediate but early stage of cleaning where we are looking at
The top screenshot to the right shows an intermediate but early stage of cleaning where we are looking at
the central emission and cleaning it out slowly.
the central emission and cleaning it out slowly.


You can use the {{viewer}} to load the average intensity
You can use the {{viewer}} to load the average intensity image:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
viewer('imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0')
viewer('imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0')
</source>
</source>
and then use the Open Data panel to load the spectral index
<tt>imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha</tt>
which can then be blinked (optionally plotted side-by-side using the Panel Display Options
panel to set 2 panels in the x direction). 


Note there is alot of noise in alpha in the low-intensity
and then use the Open Data panel to load the spectral index image <tt>imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha</tt>
regions, and thus filtering the alpha image based on the values in the tt0 image is desirable.
which can then be blinked (optionally plotted side-by-side using the Panel Display Options panel to set 2 panels in the x direction). 
You can use the {{immath}} task to make this filtered alpha image explicitly, using a  
 
Lattice Expression Language (LEL) expression:
<!--
[[Image:viewSN2010FZ_spw0to7_mfs2loadalpha.png|200px|thumb|right|clean spw0-7 mfs nterms=2 load alpha with LEL]]
 
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  
Lattice Expression Language (LEL) expression:  
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,119: Line 1,220:
       outfile='imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha.filtered')
       outfile='imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha.filtered')
</source>
</source>
This will use 50uJy (or 5 x the sigma we found) as the cutoff.
 
This will use 50 uJy (or 5 x the sigma we found) as the cutoff.
You can then view or manipulate the filtered alpha image as normal.
You can then view or manipulate the filtered alpha image as normal.


Line 1,125: Line 1,227:
by specifying a LEL string in the LEL box instead of selecting the image from the directory  
by specifying a LEL string in the LEL box instead of selecting the image from the directory  
listing.  The LEL string:
listing.  The LEL string:
<pre>
<pre>
'imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha'['imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0'>5.0E-05]
'imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha'['imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0'>5.0E-05]
</pre>
</pre>
will replicate what we did above. The middle figure to the right shows the Open Data panel
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.
with our LEL string in it.  Just click the Raster button to load this.
Line 1,134: Line 1,238:
in on the galaxy emission.  Mousing over the alpha shows spectral indexes ranging from -1 to +1 in the center, with
in on the galaxy emission.  Mousing over the alpha shows spectral indexes ranging from -1 to +1 in the center, with
the brightest emission with alpha -0.7 in the knots in the disk.
the brightest emission with alpha -0.7 in the knots in the disk.
-->


=== Cleaning using both basebands combined ===
=== Cleaning using both basebands combined ===
Line 1,143: Line 1,249:
clean.  Therefore, we will get a head start by doing a non-interactive clean using
clean.  Therefore, we will get a head start by doing a non-interactive clean using
the mask left from the previous clean (spw 0-7). We will insert a clean threshold
the mask left from the previous clean (spw 0-7). We will insert a clean threshold
to limit runaway cleaning too far beneath the noise level. This took 40min on my
to limit runaway cleaning too far beneath the noise level.  
workstation.
 
This will take a while, especially if there are other processes running on your machine (with nothing else running, expect ~30-40 minutes).
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,159: Line 1,267:
print 'Residual standard deviation = '+str(mystat['sigma'][0])
print 'Residual standard deviation = '+str(mystat['sigma'][0])
</source>
</source>
I got 8.6uJy for this effort (noticeably better than the lower baseband only results).
 
For this particular run, the rms was 8.9 uJy (noticeably better than the lower baseband only results).


[[Image:viewSN2010FZ spw0to11_mfs2resid.png|200px|thumb|right|final residual and mask]]
[[Image:viewSN2010FZ spw0to11_mfs2resid.png|200px|thumb|right|final residual and mask]]
Let us see if there is more to clean.  Bring this up in interactive mode:
Let us see if there is more to clean.  Bring this up in interactive mode:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,173: Line 1,284:
       weighting='briggs',robust=0.5,calready=True,interactive=True)
       weighting='briggs',robust=0.5,calready=True,interactive=True)
</source>
</source>
I found a few more sources revealed in the outer parts of the image, and also more  
 
emission around the galaxy disk in the center.  So I drew new boxes, extended the box
You might find a few more sources revealed in the outer parts of the image, and also more  
in the center, and did about 1000 new iterations.  At the end, what was left was dominated
emission around the galaxy disk in the center.  Try drawing new boxes, perhaps extend the box
in the center, and do ~100-1000 more iterations.  At the end, what is left should be dominated
by the error patterns from mis-calibration.  Only self-calibration will get rid of
by the error patterns from mis-calibration.  Only self-calibration will get rid of
these. Stop cleaning for now. See the figure to the right for the interactive display panel
these. Stop cleaning for now. See the figure to the right for the interactive display panel
Line 1,187: Line 1,299:
print 'Residual standard deviation = '+str(mystat['sigma'][0])
print 'Residual standard deviation = '+str(mystat['sigma'][0])
</source>
</source>
Now I get 8.3uJy.
 
The final rms achieved here is 8.6 uJy; slightly better.


== Analyzing the image and comparing with the Optical/Infrared ==
== Analyzing the image and comparing with the Optical/Infrared ==


Lets see how close we got to expected noise and dynamic range.
Let's see how close we got to expected noise and dynamic range:
 
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,210: Line 1,324:
The output gives:
The output gives:
<pre>
<pre>
Residual standard deviation = 8.33040657806e-06
Residual standard deviation = 8.60710739215e-06
Image max flux = 0.00995613634586
Image max flux = 0.00995589420199
Model total flux = 0.0329372803525
Model total flux = 0.0371581438531
SN2010FZ peak S/N = 1195.15611304
SN2010FZ peak S/N = 1156.70616717
SN2010FZ total S/N = 3953.86228077
SN2010FZ total S/N = 4317.14653485
</pre>
</pre>


What do we expect? If we do {{listobs}} on this MS we see the scans:
What do we expect? If we do {{listobs}} on this MS we see the scans:
<pre>
<pre>
Date        Timerange (UTC)          Scan  FldId FieldName nVis   Int(s)   
  Date        Timerange (UTC)          Scan  FldId FieldName           nRows   Int(s)   
11-Jul-2010/21:38:44.0 - 21:39:51.0    9      0 SN2010FZ     39312 9.11 
  11-Jul-2010/21:38:44.0 - 21:39:51.0    9      0 SN2010FZ           33696 9.16   
            21:40:01.0 - 21:41:20.5    10      0 SN2010FZ     44226 9.89
              21:40:01.0 - 21:41:20.5    10      0 SN2010FZ           37908 9.89    
            21:41:30.0 - 21:42:50.0    11      0 SN2010FZ     44226 10  
              21:41:30.0 - 21:42:50.0    11      0 SN2010FZ           37908 10      
            21:43:00.0 - 21:44:20.0    12      0 SN2010FZ     44226 10  
              21:43:00.0 - 21:44:20.0    12      0 SN2010FZ           37908 10      
            21:44:30.0 - 21:45:50.0    13      0 SN2010FZ     44226 10  
              21:44:30.0 - 21:45:50.0    13      0 SN2010FZ           37908 10      
            21:46:00.0 - 21:47:19.5    14      0 SN2010FZ     44226 9.89
              21:46:00.0 - 21:47:19.5    14      0 SN2010FZ           37908 9.89    
            21:47:29.0 - 21:47:48.5   15      0 SN2010FZ     14742 9.67
              21:47:29.0 - 21:47:49.0   15      0 SN2010FZ           12636 9.67    
            21:49:42.0 - 21:50:49.0    17      0 SN2010FZ     39312 9.11 
              21:49:42.0 - 21:50:49.0    17      0 SN2010FZ           33696 9.17   
            21:50:59.0 - 21:52:19.0    18      0 SN2010FZ     44226 10  
              21:50:59.0 - 21:52:19.0    18      0 SN2010FZ           37908 10      
            21:52:29.0 - 21:53:48.5    19      0 SN2010FZ     44226 9.89
              21:52:29.0 - 21:53:48.5    19      0 SN2010FZ           37908 9.89    
            21:53:58.0 - 21:55:18.0    20      0 SN2010FZ     44226 10  
              21:53:58.0 - 21:55:18.0    20      0 SN2010FZ           37908 10      
            21:55:28.0 - 21:56:48.0    21      0 SN2010FZ     44226 10  
              21:55:28.0 - 21:56:48.0    21      0 SN2010FZ           37908 10      
            21:56:58.0 - 21:58:18.0    22      0 SN2010FZ     44226 10  
              21:56:58.0 - 21:58:18.0    22      0 SN2010FZ           37908 10      
            21:58:28.0 - 21:58:47.0   23      0 SN2010FZ     14742 9.33 
              21:58:28.0 - 21:58:47.5   23      0 SN2010FZ           12636 9.67   
            22:00:40.0 - 22:01:47.0    25      0 SN2010FZ     39312 9.12 
              22:00:39.5 - 22:01:47.0    25      0 SN2010FZ           33696 9.18   
            22:01:57.0 - 22:03:17.0    26      0 SN2010FZ     44226 10  
              22:01:57.0 - 22:03:17.0    26      0 SN2010FZ           37908 10      
            22:03:27.0 - 22:04:47.0    27      0 SN2010FZ     44226 10  
              22:03:27.0 - 22:04:47.0    27      0 SN2010FZ           37908 10      
            22:04:57.0 - 22:06:16.5    28      0 SN2010FZ     44226 9.89
              22:04:57.0 - 22:06:16.5    28      0 SN2010FZ           37908 9.89    
            22:06:26.0 - 22:07:46.0    29      0 SN2010FZ     44226 10  
              22:06:26.0 - 22:07:46.0    29      0 SN2010FZ           37908 10      
            22:07:56.0 - 22:09:16.0    30      0 SN2010FZ     44226 10  
              22:07:56.0 - 22:09:16.0    30      0 SN2010FZ           37908 10      
            22:09:26.0 - 22:09:45.0   31      0 SN2010FZ     14742 9.33 
              22:09:26.0 - 22:09:45.5   31      0 SN2010FZ           12636 9.67   
            22:11:38.5 - 22:12:45.5    33      0 SN2010FZ     39312 9.11 
              22:11:38.0 - 22:12:45.5    33      0 SN2010FZ           33696 9.19   
            22:12:55.0 - 22:14:15.0    34      0 SN2010FZ     44226 10  
              22:12:55.0 - 22:14:15.0    34      0 SN2010FZ           37908 10      
            22:14:25.0 - 22:15:45.0    35      0 SN2010FZ     44226 10  
              22:14:25.0 - 22:15:45.0    35      0 SN2010FZ           37908 10      
            22:15:55.0 - 22:17:15.0    36      0 SN2010FZ     44226 10  
              22:15:55.0 - 22:17:15.0    36      0 SN2010FZ           37908 10      
            22:17:25.0 - 22:18:44.5    37      0 SN2010FZ     44226 9.89
              22:17:25.0 - 22:18:44.5    37      0 SN2010FZ           37908 9.89    
            22:18:54.0 - 22:20:14.0    38      0 SN2010FZ     44226 10  
              22:18:54.0 - 22:20:14.0    38      0 SN2010FZ           37908 10      
            22:20:24.0 - 22:20:43.5    39      0 SN2010FZ     14742 9.
              22:20:24.0 - 22:20:43.5    39      0 SN2010FZ           12636 9.67   
        (nVis = Total number of time/baseline visibilities per scan)  
          (nVis = Total number of time/baseline visibilities per scan)  
</pre>
</pre>
(listing columns truncated) and we estimate about 37min on target. We had
(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
about 25 antennas on average, and our spw selection picked out  
610 channels (2MHz each) for a total of 1220MHz bandwidth.  If we plug this
into the
into the
[https://science.nrao.edu/facilities/evla/calibration-and-tools/exposure "EVLA exposure calculator"]
[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). 
then we find that we expect a rms thermal noise level of 7.6uJy so we are close!


[[Image:plotSN2010FZ_viewerfinal.png|200px|thumb|right|final image]]
[[Image:plotSN2010FZ_viewerfinal.png|200px|thumb|right|final image]]
Line 1,270: Line 1,381:
an intensity-weighted mean spectral index over the core region.
an intensity-weighted mean spectral index over the core region.
The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image.  See the figure to the right.
The <tt>.image.tt1</tt> from our mfs is an intensity times alpha image.  See the figure to the right.
Lets gate the Taylor-term images on intensity as before:
Let's gate the Taylor-term images on intensity:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,303: Line 1,414:
We get  
We get  
<pre>
<pre>
SN2010FZ I-weighted Alpha = -1.54687681754
SN2010FZ I-weighted Alpha = -1.38157453384
</pre>
</pre>
The emission in this source is on the steep side. At this point we do not know how reliable this is or
The emission in this source is on the steep side. At this point we do not know how reliable this is or
what we expect (though our calibrators come out with correct spectral indexes if we image them the
what we expect (though our calibrators come out with correct spectral indexes if we image them the
Line 1,312: Line 1,424:
[[Image:NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg|400px|thumb|center|]]
[[Image:NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg|400px|thumb|center|]]
from their [http://cosmo.nyu.edu/hogg/rc3/NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg RC3]
from their [http://cosmo.nyu.edu/hogg/rc3/NGC_2967_UGC_5180_IRAS_09394+0033_irg.jpg RC3]
album (courtesy D.Hogg,M.Blanton,SDSS collaboration - see [[#Credits]]). This looks like a nice nearby
album (courtesy D.Hogg, M.Blanton, SDSS collaboration - see [[#Credits]]). This looks like a nice nearby
face-on spiral galaxy. How does our 6cm continuum emission line up with the optical?
face-on spiral galaxy. How does our 6cm continuum emission line up with the optical?


Here is the EVLA 6cm image side by side with a i-band image from the Sloan Digital Sky Survey (SDSS) registered
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:
to our image:
 
[[Image:plotSN2010FZ viewerfinalandSDSS.png|600px|thumb|center|final and sdss image]]
[[Image:plotSN2010FZ viewerfinalandSDSS.png|600px|thumb|center|final and sdss image]]
You can also find this image and load it into your viewer, and blink against our 6cm image.
 
You can also find this image (at the CASA workshop, it's in <tt>/data/casa/evla/NGC_2967_UGC_5180_IRAS_09394+0033-i.fits</tt>) and load it into your viewer, and blink against our 6cm image.


We can also plot one as a raster and the other overlaid as contours. You can load the SDSS image
We can also plot one as a raster and the other overlaid as contours. You can load the SDSS image
from the viewer Load Data panel and fiddle with contours. Once you know contour levels, you can
from the viewer Load Data panel and fiddle with contours. Once you know contour levels, you can
also use the imview task to load a raster and contour image:
also use the imview task to load a raster and contour image:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,331: Line 1,445:
                   'unit' : 1.0 } )
                   'unit' : 1.0 } )
</source>
</source>
The figure below shows the SDSS contours overlaid on our 6cm image (after fiddling with the  
The figure below shows the SDSS contours overlaid on our 6cm image (after fiddling with the  
colormap shift/slope for the EVLA raster image).  
colormap shift/slope for the EVLA raster image).  
[[Image:viewSN2010FZ_spw0to11_mfs2tt0plusSDSS.png|400px|thumb|center|6cm EVLA raster plus SDSS i-band contours]]
[[Image:viewSN2010FZ_spw0to11_mfs2tt0plusSDSS.png|400px|thumb|center|6cm EVLA raster plus SDSS i-band contours]]


Likewise, we can plot the SDSS image as a raster and overlay EVLA 6cm contours:
Likewise, we can plot the SDSS image as a raster and overlay EVLA 6cm contours:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
Line 1,348: Line 1,465:
                 'trc' : [1567,1231] } )
                 'trc' : [1567,1231] } )
</source>
</source>
This is shown in the figure below.  Is the compact 6cm emission in upper left associated with a
This is shown in the figure below.  Is the compact 6cm emission in upper left associated with a
spiral arm?
spiral arm?
[[Image:viewSN2010FZ_spw0to11_SDSSiplusEVLA6cm.png|400px|thumb|center|SDSS i-band raster plus EVLA 6cm contours]]
[[Image:viewSN2010FZ_spw0to11_SDSSiplusEVLA6cm.png|400px|thumb|center|SDSS i-band raster plus EVLA 6cm contours]]


Line 1,356: Line 1,475:
Here are a number of things you can try after completing this tutorial:
Here are a number of things you can try after completing this tutorial:


# Use self-calibration to improve the data and re-clean to make a better image.
# 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.
# Use multi-scale clean by adding non-zero scales to the <tt>multiscale</tt> parameter.
# Use multi-scale clean by adding non-zero scales to the <tt>multiscale</tt> parameter.
# 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)?
# 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)?
# Try the <tt>testautoflag</tt> task (in 3.3.0 and later) to automatically flag RFI from the upper sideband.
# 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].


== Credits ==
== Credits ==

Latest revision as of 05:44, 19 January 2012

Overview

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.

This is a more advanced tutorial, and if you are a relative novice (and particularly for EVLA continuum calibration and imaging), it is strongly 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.

From the [MainPage] of this guide you can find helpful information:

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 Script Extractor to create a file with the tutorial commands, which can subsequently be edited as desired.

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 the task parameters you do not set in the function call (assuming there is at least one) will be set to their defaults, and will not use values you set in 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.

NOTE: If you find that the figures on the right margin of the browser window overlap the text too much and make reading difficult, go ahead and widen the browser window.

CASA Versions

This tutorial was written for the CASA Version 3.2.1 (release r15198 26 May 2011). It has also been verified to work in the release Version 3.3.0 (r16617, 12 Oct 2011).

Obtaining the Data

The method you should use to get your data depends on whether you are at the Caltech CASA Radio Analysis Workshop or are doing the tutorial on your own.

At the Caltech CASA Radio Analysis Workshop

At the workshop, we will be using data which has already been placed on a drive which is accessible with the cluster machines we'll be using. The data directory is /data/casa/, and either evla or alma, depending on the tutorial. Note that many CASA operations are very i/o intensive, so you will place your working data on a disk local to your login node. While this is the fastest setup, there is limited space on these local disks. Therefore, we suggest that you check how much free space remains (using "df -k ."), and delete any data from a previous tutorial before starting a new one, if needed.

While you should read through the first few sections, the Measurement Set (MS) you will be starting with has already had the first few steps performed, to save both time and disk space. To copy this your local directory, do the following (substitute your username number for the "??", and use either /scr or /scr2, depending on your node assignment):

cd /scr[2]/casa/
mkdir casauser??
cd casauser??
mkdir evla_6-cm_wideband
cd evla_6-cm_wideband
tar -xvf /data/casa/evla/tar/SN2010FZ_10s.tar

This will take a minute, but once it's complete, you will have a directory called SN2010FZ_10s.ms which is the filled data, with online flags applied (which delete known bad data), and time-averaged to 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.) This is equivalent to what you would download from the archive if you request time-averaging and online flag application.

On your own

The data for this tutorial were taken with the EVLA under program AS1015 as the scheduling block (SB) AS1015_sb1658169_1.55388.89474846065, and was run on 2010-07-11 from 21:28 to 22:28 UT (size 37.74GB). This can be downloaded from the NRAO Science Data Archive, with online flags applied (check box "Apply flags generated during observing") and time-averaging set to 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.) This will create a file equivalent to what is used at the workshop. (Note that these data will not become public, and will therefore not be downloadable, until 25 Aug 2012.)

Starting CASA

To start CASA, type:

casapy

This will run a script to initialize CASA, setting paths appropriately. It will also start writing to a file called ipython.log, which will contain a record of all the text you enter at the CASA prompt.

A logger window will also appear; note that you can rescale this window or change the font size as desired (the latter is under "View"). The messages which are printed to the logger are also saved to a file called casalog.py, and any previous version of casalog.py which may have been present is moved to a backup version with a date stamp. Note that this does not happen for any previous versions of ipython.log, so if you wish to save one, be sure to rename it before restarting CASA.

Examining the MS

We use listobs to summarize our MS:

# In CASA
listobs('SN2010FZ_10s.ms')

In the logger you should see:

##########################################
##### Begin Task: listobs            #####

================================================================================
           MeasurementSet Name:  /scr2/casa/evla_6-cm_wideband/SN2010FZ_10s.ms      MS Version 2
================================================================================
   Observer: Dr. Alicia M. Soderberg     Project: T.B.D.  
Observation: EVLA
Data records: 1570726       Total integration time = 3359 seconds
   Observed from   11-Jul-2010/21:30:44.0   to   11-Jul-2010/22:26:43.0 (UTC)

   ObservationID = 0         ArrayID = 0
  Date        Timerange (UTC)          Scan  FldId FieldName           nRows   Int(s)   SpwIds      ScanIntent
  11-Jul-2010/21:30:44.0 - 21:30:52.0     2      0 J0925+0019          404    6.43     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
              21:31:02.0 - 21:32:22.0     3      0 J0925+0019          5062   9.68     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
              21:32:32.0 - 21:33:52.0     4      0 J0925+0019          6277   9.91     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
              21:34:02.0 - 21:34:52.0     5      0 J0925+0019          4148   9.96     [0, 1]                      CALIBRATE_PHASE#UNSPECIFIED
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
           (nVis = Total number of time/baseline visibilities per scan) 
Fields: 3
  ID   Code Name                RA              Decl          Epoch   SrcId nVis   
  0    D    J0925+0019          09:25:07.81503 +00.19.13.9334 J2000   0     303381 
  1    NONE SN2010FZ            09:42:04.77000 +00.19.51.0000 J2000   1     1218560
  2    K    3C286               13:31:08.28798 +30.30.32.9589 J2000   2     48785  
   (nVis = Total number of time/baseline visibilities per field) 
Spectral Windows:  (18 unique spectral windows and 1 unique polarization setups)
  SpwID  #Chans Frame Ch1(MHz)    ChanWid(kHz)  TotBW(kHz)  Corrs          
  0          64 TOPO  7686        2000          128000      RR  RL  LR  LL  
  1          64 TOPO  7836        2000          128000      RR  RL  LR  LL  
  2          64 TOPO  4488        2000          128000      RR  RL  LR  LL  
  3          64 TOPO  4616        2000          128000      RR  RL  LR  LL  
  4          64 TOPO  4744        2000          128000      RR  RL  LR  LL  
  5          64 TOPO  4872        2000          128000      RR  RL  LR  LL  
  6          64 TOPO  5000        2000          128000      RR  RL  LR  LL  
  7          64 TOPO  5128        2000          128000      RR  RL  LR  LL  
  8          64 TOPO  5256        2000          128000      RR  RL  LR  LL  
  9          64 TOPO  5384        2000          128000      RR  RL  LR  LL  
  10         64 TOPO  6488        2000          128000      RR  RL  LR  LL  
  11         64 TOPO  6616        2000          128000      RR  RL  LR  LL  
  12         64 TOPO  6744        2000          128000      RR  RL  LR  LL  
  13         64 TOPO  6872        2000          128000      RR  RL  LR  LL  
  14         64 TOPO  7000        2000          128000      RR  RL  LR  LL  
  15         64 TOPO  7128        2000          128000      RR  RL  LR  LL  
  16         64 TOPO  7256        2000          128000      RR  RL  LR  LL  
  17         64 TOPO  7384        2000          128000      RR  RL  LR  LL  
Sources: 50
  ID   Name                SpwId RestFreq(MHz)  SysVel(km/s) 
  0    J0925+0019          0     -              -            
  0    J0925+0019          1     -              -            
  0    J0925+0019          2     -              -            
  0    J0925+0019          3     -              -            
  0    J0925+0019          4     -              -            
  0    J0925+0019          5     -              -            
  0    J0925+0019          6     -              -            
  0    J0925+0019          7     -              -            
  0    J0925+0019          8     -              -            
  0    J0925+0019          9     -              -            
  0    J0925+0019          10    -              -            
  0    J0925+0019          11    -              -            
  0    J0925+0019          12    -              -            
  0    J0925+0019          13    -              -            
  0    J0925+0019          14    -              -            
  0    J0925+0019          15    -              -            
  0    J0925+0019          16    -              -            
  0    J0925+0019          17    -              -            
  1    SN2010FZ            2     -              -            
  1    SN2010FZ            3     -              -            
  1    SN2010FZ            4     -              -            
  1    SN2010FZ            5     -              -            
  1    SN2010FZ            6     -              -            
  1    SN2010FZ            7     -              -            
  1    SN2010FZ            8     -              -            
  1    SN2010FZ            9     -              -            
  1    SN2010FZ            10    -              -            
  1    SN2010FZ            11    -              -            
  1    SN2010FZ            12    -              -            
  1    SN2010FZ            13    -              -            
  1    SN2010FZ            14    -              -            
  1    SN2010FZ            15    -              -            
  1    SN2010FZ            16    -              -            
  1    SN2010FZ            17    -              -            
  2    3C286               2     -              -            
  2    3C286               3     -              -            
  2    3C286               4     -              -            
  2    3C286               5     -              -            
  2    3C286               6     -              -            
  2    3C286               7     -              -            
  2    3C286               8     -              -            
  2    3C286               9     -              -            
  2    3C286               10    -              -            
  2    3C286               11    -              -            
  2    3C286               12    -              -            
  2    3C286               13    -              -            
  2    3C286               14    -              -            
  2    3C286               15    -              -            
  2    3C286               16    -              -            
  2    3C286               17    -              -            
Antennas: 27:
  ID   Name  Station   Diam.    Long.         Lat.         
  0    ea01  W09       25.0 m   -107.37.25.2  +33.53.51.0  
  1    ea02  E02       25.0 m   -107.37.04.4  +33.54.01.1  
  2    ea03  E09       25.0 m   -107.36.45.1  +33.53.53.6  
  3    ea04  W01       25.0 m   -107.37.05.9  +33.54.00.5  
  4    ea05  W08       25.0 m   -107.37.21.6  +33.53.53.0  
  5    ea06  N06       25.0 m   -107.37.06.9  +33.54.10.3  
  6    ea08  N01       25.0 m   -107.37.06.0  +33.54.01.8  
  7    ea09  E06       25.0 m   -107.36.55.6  +33.53.57.7  
  8    ea10  N03       25.0 m   -107.37.06.3  +33.54.04.8  
  9    ea11  E04       25.0 m   -107.37.00.8  +33.53.59.7  
  10   ea12  E08       25.0 m   -107.36.48.9  +33.53.55.1  
  11   ea13  N07       25.0 m   -107.37.07.2  +33.54.12.9  
  12   ea14  E05       25.0 m   -107.36.58.4  +33.53.58.8  
  13   ea15  W06       25.0 m   -107.37.15.6  +33.53.56.4  
  14   ea16  W02       25.0 m   -107.37.07.5  +33.54.00.9  
  15   ea17  W07       25.0 m   -107.37.18.4  +33.53.54.8  
  16   ea18  N09       25.0 m   -107.37.07.8  +33.54.19.0  
  17   ea19  W04       25.0 m   -107.37.10.8  +33.53.59.1  
  18   ea20  N05       25.0 m   -107.37.06.7  +33.54.08.0  
  19   ea21  E01       25.0 m   -107.37.05.7  +33.53.59.2  
  20   ea22  N04       25.0 m   -107.37.06.5  +33.54.06.1  
  21   ea23  E07       25.0 m   -107.36.52.4  +33.53.56.5  
  22   ea24  W05       25.0 m   -107.37.13.0  +33.53.57.8  
  23   ea25  N02       25.0 m   -107.37.06.2  +33.54.03.5  
  24   ea26  W03       25.0 m   -107.37.08.9  +33.54.00.1  
  25   ea27  E03       25.0 m   -107.37.02.8  +33.54.00.5  
  26   ea28  N08       25.0 m   -107.37.07.5  +33.54.15.8  

##### End Task: listobs              #####
##########################################

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 X 360 X 16 = 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).

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 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.

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.

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.

The field listing shows three sources:

  • J0925+0019 (also referred to by its field ID, 0), which will serve as a calibrator for the visibility phases,
  • SN2010FZ (1), our science target field, and
  • 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.

Flagging the MS

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 FLAG_CMD. (In fact, the information for this table is actually a subdirectory within the MS; you can see this by listing the contents of SN2010FZ_10s.ms.)

online flags plotted from flagcmd

You can examine the commands stored in the FLAG_CMD table using flagcmd.

# In CASA
flagcmd(vis='SN2010FZ_10s.ms',flagmode='table',optype='list')

These will go to the logger.

You can also plot the commands stored in the FLAG_CMD table:

# In CASA
myrows = range(285)
flagcmd(vis='SN2010FZ_10s.ms',flagmode='table',optype='plot',flagrows=myrows)

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 antenna shadowing.

This will bring up a matplotlib plotter. You can have it plot to a PNG file instead:

# In CASA
flagcmd(vis='SN2010FZ_10s.ms',flagmode='table',optype='plot',flagrows=myrows,outfile='plotSN2010FZ_flagcmd.png')

The flags as plotted in the figure to the above right look normal. They are color-coded by REASON, and you see OFF_SOURCE flags between scans, and the occasional SUBREFLECTOR flag also between scans (most likely after band changes when the subreflector rotates to pick up the new feed on the ring, some are slower than others). What you watch for here are long blocks of unexpected flags like FOCUS, 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.

plotants plotter

To plot up the antenna positions in the array:

# In CASA
plotants('SN2010FZ_10s.ms')

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:

# In CASA
clearstat

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. NOTE: We do not recommend using the editing/flagging features of plotms. 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.

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.

NOTE: If you need an introduction to plotms, see:

WARNING: The Flag 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!

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:

plotms amp vs time
# In CASA
plotms(vis='SN2010FZ_10s.ms',field='',spw='2~17:31~31', \
       antenna='ea01&ea02',correlation='RR,LL',xaxis='time',yaxis='amp')

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".

plotms ant2 vs ea01

Look for bad antennas by picking the last field and plotting baselines versus antenna ea01:

# In CASA
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17:31~31', \
       antenna='ea01',correlation='RR,LL',xaxis='antenna2',yaxis='amp')

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 tool and using the Locate 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.)

plotms ea02 vs frequency

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:

# In CASA
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17', \
       antenna='ea02;!ea13',correlation='RR,LL',xaxis='frequency',yaxis='amp')

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.

plotms ea02&ea20 iteration phase vs frequency

We can also step through the baselines to our antenna using iteraxis - use the Next Iteration button to step through:

# In CASA
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',iteraxis='baseline')

This will make it easier to isolate the bad antennas. Now plot the phases, iterating through baselines to ea02:

# In CASA
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02;!ea13', \
       correlation='RR,LL',xaxis='frequency',yaxis='phase',iteraxis='baseline')

You see the slopes due to residual delays. Mostly a turn or less over a 128MHz subband, but there are some outliers. Step through to ea20. You see that there is a very large delay in RR (via locate) for 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). 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.

To carry out flagging, we again use flagcmd in the mode where it takes a list of command strings:

# In CASA
flaglist = ['antenna="ea13"',
            'antenna="ea17" spw="10~17"',
            'antenna="ea25" spw="10~17"',
            'antenna="ea20" spw="2~9"']
flagcmd(vis='SN2010FZ_10s.ms',flagmode='cmd',command=flaglist,optype='apply',flagbackup=False)

These commands will be carried out as well as being added to the FLAG_CMD table (marked as applied).

Plot the data again, now that is has been flagged:

# In CASA
plotms(vis='SN2010FZ_10s.ms',field='2',spw='2~17',antenna='ea02', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')
plotms field 0 ea02 amp vs frequency

Now our phase calibrator - it is weaker, and we now start to really see the RFI:

# In CASA
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17',antenna='ea02', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')

Use the Zoom feature, Mark rectangles and use Locate to identify the frequency/channel of RFI. In particular, we note in our analysis:

  • 6614MHz (spw 10 ch 63) super strong
  • 6772-6778MHz (spw 12 ch 14-17)
  • 7260-7264MHz (spw 16 ch 2-4)
  • 7314-7340MHz (spw 16 ch 29-42)
  • 7402-7418MHz (spw 17 ch 9-17)
  • 7458-7466MHz (spw 17 ch 37-41)
  • 7488MHz (spw 17 ch 52)

If you plot all antennas and avoid the band edges you see spw 16 and 17 are pretty wiped out:

# In CASA
plotms(vis='SN2010FZ_10s.ms',field='0',spw='2~17:4~59',antenna='', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',scan='7~43')

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.

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.

# In CASA
split(vis='SN2010FZ_10s.ms',outputvis='SN2010FZ_flagged10s.ms',datacolumn='data',spw='2~9,12~17',scan='7~43')

You now have a MS called SN2010FZ_flagged10s.ms in your working area. This should be 2.8GB in size, which you can see while still at the CASA command prompt by typing:

# In CASA
os.system('du -sh SN2010FZ_flagged10s.ms')

Note that the built-in system function allows one to execute UNIX shell commands within a CASA session. (Some, like ls, don't need this extra wrapper, but most are not automatically understood.)

Calibration

Summarize the split flagged MS:

# In CASA
listobs('SN2010FZ_flagged10s.ms')

In the logger we see:

##########################################
##### Begin Task: listobs            #####

================================================================================
           MeasurementSet Name:  /scr2/casa/evla_6-cm_wideband/SN2010FZ_flagged10s.ms      MS Version 2
================================================================================
   Observer: Dr. Alicia M. Soderberg     Project: T.B.D.  
Observation: EVLA
Data records: 1375038       Total integration time = 3042 seconds
   Observed from   11-Jul-2010/21:36:01.0   to   11-Jul-2010/22:26:43.0 (UTC)

   ObservationID = 0         ArrayID = 0
  Date        Timerange (UTC)          Scan  FldId FieldName           nRows   Int(s)   SpwIds      ScanIntent
  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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
              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
           (nVis = Total number of time/baseline visibilities per scan) 
Fields: 3
  ID   Code Name                RA              Decl          Epoch   SrcId nVis   
  0    D    J0925+0019          09:25:07.81503 +00.19.13.9334 J2000   0     230230 
  1    NONE SN2010FZ            09:42:04.77000 +00.19.51.0000 J2000   1     1100736
  2    K    3C286               13:31:08.28798 +30.30.32.9589 J2000   2     44072  
   (nVis = Total number of time/baseline visibilities per field) 
Spectral Windows:  (14 unique spectral windows and 1 unique polarization setups)
  SpwID  #Chans Frame Ch1(MHz)    ChanWid(kHz)  TotBW(kHz)  Corrs          
  0          64 TOPO  4488        2000          128000      RR  RL  LR  LL  
  1          64 TOPO  4616        2000          128000      RR  RL  LR  LL  
  2          64 TOPO  4744        2000          128000      RR  RL  LR  LL  
  3          64 TOPO  4872        2000          128000      RR  RL  LR  LL  
  4          64 TOPO  5000        2000          128000      RR  RL  LR  LL  
  5          64 TOPO  5128        2000          128000      RR  RL  LR  LL  
  6          64 TOPO  5256        2000          128000      RR  RL  LR  LL  
  7          64 TOPO  5384        2000          128000      RR  RL  LR  LL  
  8          64 TOPO  6744        2000          128000      RR  RL  LR  LL  
  9          64 TOPO  6872        2000          128000      RR  RL  LR  LL  
  10         64 TOPO  7000        2000          128000      RR  RL  LR  LL  
  11         64 TOPO  7128        2000          128000      RR  RL  LR  LL  
  12         64 TOPO  7256        2000          128000      RR  RL  LR  LL  
  13         64 TOPO  7384        2000          128000      RR  RL  LR  LL  
<snip>

Note that the spectral windows are re-numbered to 0 through 13.

Prepare the MS for calibration by adding the "scratch columns" which will contain the model (MODEL_DATA) and the calibrated data (CORRECTED_DATA). This is done by clearcal, which will create the columns if they don't already exist, and initialize their values to be equal to those of the raw data (DATA).

# In CASA
clearcal('SN2010FZ_flagged10s.ms')

Setting the flux density scale

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. For much more discussion of the philosophy, strategy, and implementation of calibration of synthesis data within CASA, see Synthesis Calibration in the CASA Cookbook and User Reference Manual .

Before calibrating, we insert a model for flux calibration source 3C286 into the MS (in the MODEL_DATA column we just created). 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:

# In CASA
setjy(vis='SN2010FZ_flagged10s.ms', listmodimages=True)

The relevant image for our purposes is 3C286_C.im, in the directory /usr/local/casapy-3.3.0/data/nrao/VLA/CalModels. Your system may vary.

# In CASA
setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, \
      modimage='/usr/local/casapy-3.3.0/data/nrao/VLA/CalModels/3C286_C.im')
  • scalebychan=True: will fill the model with per-channel values; otherwise, setjy would use a single value per spectral window.

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.

Calibrating delays and bandpass

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 - ea02 is a reasonable bet:

# In CASA
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G0',field='2',spw='0~13:23~28', \
        gaintype='G',refant='ea02',calmode='p',solint='int',minsnr=3)
  • solint='int': do a per-integration solve (every 10 seconds, since we've time-averaged the data)
  • minsnr=3: apply a minimum signal-to-noise cutoff. Solutions with less than this value will be flagged.
plotcal G0 phase ant 0~15
plotcal G0 phase ant 16~26

Plot the phase solutions (using full phase range, -180 to 180, instead of autorange):

# In CASA
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase',iteration='antenna', \
        plotrange=[-1,-1,-180,180])

Step through the antenna-based solutions. They look good (and fairly flat over the scans). NOTE: 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:

# In CASA
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase', \
        antenna='0~10,12~15',subplot=531,iteration='antenna', \
        plotrange=[-1,-1,-180,180],showgui=False,fontsize=6.0, \
        figfile='plotSN2010FZ_plotcal_G0p1.png')
plotcal(caltable='calSN2010FZ.G0',xaxis='time',yaxis='phase', \
        antenna='16~26',subplot=531,iteration='antenna', \
        plotrange=[-1,-1,-180,180],showgui=False,fontsize=6.0, \
        figfile='plotSN2010FZ_plotcal_G0p2.png')

We can now solve for the residual antenna-based delays that we saw in phase vs. frequency. This uses the new gaintype='K' 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 to all baselines to the refant, 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 beginning of spw 0 due to the extreme roll-off (with loss of S/N) at the starting edge.

# In CASA
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.K0',gaintable='calSN2010FZ.G0', \
        field='2',spw='0:8~59,1~13:4~59',gaintype='K', \
        refant='ea02',combine='scan',solint='inf',minsnr=3)

We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration. We can plot the delays, as a function of time (note that the units on the y-axis are nanoseconds):

# In CASA
plotcal(caltable='calSN2010FZ.K0', xaxis='time', yaxis='real')

The delays range from around -6 to 6 nanoseconds.

Now solve for the bandpass using the previous tables:

# In CASA
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0', \
         gaintable=['calSN2010FZ.G0','calSN2010FZ.K0'], \
         field='2',refant='ea02',solnorm=False, \
         bandtype='B', combine='scan', solint='inf', gaincurve=True)

WARNING: You must set solnorm=False here or later on you will find some offsets between spw due to how amplitude scaling adjusts weights internally during solving.

This is the first amplitude-scaling calibration that we do, and thus we have turned on the application of gain-elevation curves (setting gaincurve=True). If we were at higher frequency we would set the opacity here also. We will set these in every amplitude solve and application from now on.

Now plot this, in amplitude then phase:

# In CASA
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp',iteration='antenna')
#
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase',iteration='antenna', \
        plotrange=[-1,-1,-180,180])

In the bandpass phase 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. Note that some antennas have a little strange bandpasses at upper end of lower baseband in spw 5,6,7 (e.g. ea14,ea16,ea17,ea25). To plot amp and phase for a single antenna versus frequency (see plots at right):

plotcal B0 amp and phase vs. freq for ea14
# In CASA
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='amp', \
        antenna='ea14',subplot=211)
plotcal(caltable='calSN2010FZ.B0',xaxis='freq',yaxis='phase', \
        antenna='ea14',subplot=212,plotrange=[-1,-1,-180,180])

Because our flux density calibrator 3C286 is bright enough, we were able to use this as the bandpass calibrator. Since setjy put the correct spectrum for 3C286 into the MODEL_DATA column, our bandpass will reflect the true bandpass of the instrument. However, if for your observation you were unable to use a source of known spectrum as the bandpass calibrator, then you would need to follow this bandpass with a second one on a source of known spectrum in order to take out the spurious bandpass slope introduced by the (unknown) intrinsic spectral shape of your calibrator.

Running bandpass with bandtype='BPOLY' and degamp=1 should suffice to take out a slope, albeit on a per-antenna basis rather than over the entire array. This should work as long as you have enough S/N on your flux calibrator to solve for two polynomial orders (might be hard if you are using very narrow bands at high frequency).

Final phase and amplitude calibration

plotcal G1 phase ant 0~15
plotcal G1 phase ant 16~26

Now calibrate phases using the full bandwidth. First the flux calibrator again, with a per-integration solution time:

# In CASA
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1', \
        gaintable=['calSN2010FZ.K0','calSN2010FZ.B0'], \
        field='2',refant='ea02',solnorm=F, spw='0~13:4~59', \
        solint='int',gaintype='G',calmode='p')

Next our phase calibrator, appending these solutions to previous table. Exclude RFI channels here, and obtain one solution per scan (since this is a fainter source):

# In CASA
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1',
        gaintable=['calSN2010FZ.K0','calSN2010FZ.B0'], \
        field='0',refant='ea02',solnorm=F, \
        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', \
        solint='inf',gaintype='G',calmode='p',append=True)

The phases look reasonably connected:

# In CASA
plotcal(caltable='calSN2010FZ.G1',xaxis='time',yaxis='phase',iteration='antenna', \
        plotrange=[-1,-1,-180,180])

NOTE: If there were significant phase variations then you would also do short-timescale phase solutions on the gain calibrator (field 0), as we did for 3C286, that you would apply only to that calibrator in order to get the amplitude solutions correct. You would still apply the per-scan phases to the target. Because we have good phase stability we will only do per-scan phase solutions on J0925+0019 and use that in both the amplitude solutions and to correct the target phases.

Now solve for amplitudes on a per scan interval. Do these separately using gainfield so phases don't get transferred across fields. Note that gaincal uses linear interpolation of the previously determined phases by default. Pre-apply the gaincurve as well:

# In CASA
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2', \
        gaintable=['calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1'], \
        gainfield=['2','2','2'], field='2',refant='ea02',solnorm=F,
        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', \
        solint='inf',gaintype='G',calmode='a',gaincurve=True)
#
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2', \
        gaintable=['calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1'],\
        gainfield=['2','2','0'], field='0',refant='ea02',solnorm=F, \
        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', \
        solint='inf',gaintype='G',calmode='a',gaincurve=True,append=True)
plotcal F2 amp ant 0~15
plotcal F2 amp ant 16~26

Since the flux on the gain calibrator is not scaled to its correct flux (but to 1.0 Jy by default), use fluxscale to transfer the amplitude gains from 3c286:

# In CASA
fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G2', \
          fluxtable='calSN2010FZ.F2',reference='2',transfer='0')

The logger output gives:

Found reference field(s): 3C286
Found transfer field(s):  J0925+0019
Flux density for J0925+0019 in SpW=0 is: 0.976619 +/- 0.00285581 (SNR = 341.976, N= 50)
Flux density for J0925+0019 in SpW=1 is: 0.978306 +/- 0.00262726 (SNR = 372.367, N= 50)
Flux density for J0925+0019 in SpW=2 is: 0.980252 +/- 0.00252457 (SNR = 388.285, N= 50)
Flux density for J0925+0019 in SpW=3 is: 0.981104 +/- 0.0025413 (SNR = 386.064, N= 50)
Flux density for J0925+0019 in SpW=4 is: 0.982537 +/- 0.00232622 (SNR = 422.375, N= 50)
Flux density for J0925+0019 in SpW=5 is: 0.986066 +/- 0.00308253 (SNR = 319.889, N= 50)
Flux density for J0925+0019 in SpW=6 is: 0.988012 +/- 0.00355626 (SNR = 277.823, N= 50)
Flux density for J0925+0019 in SpW=7 is: 0.98155 +/- 0.00224373 (SNR = 437.464, N= 50)
Flux density for J0925+0019 in SpW=8 is: 0.962152 +/- 0.00302232 (SNR = 318.349, N= 48)
Flux density for J0925+0019 in SpW=9 is: 0.958591 +/- 0.00304029 (SNR = 315.296, N= 48)
Flux density for J0925+0019 in SpW=10 is: 0.956297 +/- 0.0031889 (SNR = 299.883, N= 48)
Flux density for J0925+0019 in SpW=11 is: 0.95489 +/- 0.00389993 (SNR = 244.848, N= 48)
Flux density for J0925+0019 in SpW=12 is: 0.952233 +/- 0.00426962 (SNR = 223.025, N= 48)
Flux density for J0925+0019 in SpW=13 is: 0.947977 +/- 0.00426486 (SNR = 222.276, N= 48)

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, the number of polarizations is 2 (RR and LL).

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 5 then falls again.

Plot these solutions:

# In CASA
plotcal(caltable='calSN2010FZ.F2',xaxis='time',yaxis='amp',iteration='antenna')

The gains on 3C286 are about 1 (the bandpass solution on 3C286 has absorbed the calibration from counts to Jy) but fluxscale has adjusted the per-spw scale on J0925+0019 to get its correct spectrum rather than the assumed 1 Jy flat spectrum.

Applying the Calibration, Final Editing, and a Quick Recalibration

Next we actually apply all our accumulated calibration tables. We apply these to the calibration fields individually using the appropriate gainfields and interpolation for each:

  • For 3C286 (field 2) we did short-timescale phase solutions and a single scan amplitude, so use "linear" and "nearest" interpolation respectively.
  • For the nearby gain calibrator (field 0) we did only scan-based phase and amplitude solutions so we use "nearest" interpolation
  • For the target source we use field 0 to calibrate field 1, so use "linear" interpolation. This takes a few minutes.
plotms of 3C286 with calibration applied
# In CASA
applycal(vis='SN2010FZ_flagged10s.ms',field='2', \
         gaintable=['calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1','calSN2010FZ.F2'], \
         gainfield=['','','2','2'],interp=['nearest','nearest','linear','nearest'], \
         parang=False,calwt=F,gaincurve=T)
#
applycal(vis='SN2010FZ_flagged10s.ms',field='0', \
         gaintable=['calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1','calSN2010FZ.F2'], \
         gainfield=['','','0','0'], interp=['nearest','nearest','nearest','nearest'], \
         parang=False,calwt=F,gaincurve=T)
#
applycal(vis='SN2010FZ_flagged10s.ms',field='1', \
         gaintable=['calSN2010FZ.K0','calSN2010FZ.B0','calSN2010FZ.G1','calSN2010FZ.F2'], \
         gainfield=['','','0','0'], interp=['nearest','nearest','linear','linear'], \
         parang=False,calwt=F,gaincurve=T)

We can examine the corrected data on 3c286 using our RFI mask from above and avoiding band edges

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \
       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', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

See figure above right. There is clearly discrepant data visible spw 5 and 6, in particular for baseline ea17&ea25 (use the Mark Regions tool on some of it and then use the Locate tool), which gives a really strange response. You can plot just this baseline to be sure:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \
       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', \
       antenna='ea17&ea25', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

You can exclude this through antenna negation:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \
       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', \
       antenna='!ea17&ea25', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

Then use Locate for the other bad points, which seem to indicate spw 5,6,7 for ea14,ea16,ea17,ea25. Exclude these and replot:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \
       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', \
       antenna='!ea14;!ea16;!ea17;!ea25', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
plotms cal applied flagged fld2

This now looks clean except for the RFI in the upper subbands.

Do flagging based on these:

# In CASA
flaglist = ['antenna="ea14,ea16,ea17,ea25" spw="5~7"']
flagcmd(vis='SN2010FZ_flagged10s.ms',flagmode='cmd',command=flaglist, \
        optype='apply',flagbackup=False)

Now replot the corrected data (you may have to force reload if you plotted same thing right before this):

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \
       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', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

Looks pretty good.

Plot the phase:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='2', \
       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', \
       correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')
plotms cal applied flagged fld2 phase

Note the characteristic "bowtie" pattern of the phases about the sub-band centers. Here we can see the effect of the EVLA "delay clunking", where the delay steps through discrete values such that 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).

Now let's plot the corrected data amplitude for the phase calibrator (field 0):

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       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', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')
plotms cal applied flagged fld0 amp
plotms cal applied flagged fld0 phase

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:

  • <6804 MHz spw 8 below ch 30 lots of bad stuff (a lot from ea18,ea22 but others too)
  • 7168 MHz spw 11 ch 20
  • pretty much all of spw 12,13

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 tool.

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:

spw = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'

Without further flagging, it may be best to drop spw 12-13 for imaging (we will do so from now on).

Plot again (including this selection for spw 0-11):

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

Looks better.

plotms cal applied flagged fld0 amp averaged

Now plot amplitudes for the corrected data averaged over baseline to see the source spectrum:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       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', \
       correlation='RR,LL',avgbaseline=True,avgtime='60000s',
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

The last two sub-bands spw 12-13 give reasonable values, with only a tiny offset from spw 8-11. There are also strange amplitude excursions, particularly in the low end of the first baseband. These must be coming from one or more scans. You can iterate over scan to see the strange amplitudes (mostly from scan 7):

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       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', \
       correlation='RR,LL',avgbaseline=True,avgtime='600s',iteraxis='scan',
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

Also, there is something odd with the amplitudes for spw 5-6, perhaps due to the problem with baseline ea17&ea25 (which we flagged, but didn't recalibrate afterward). This is troubling enough that we will quickly go through a second round of calibration. We may as well flag scan 7 first, as well:

# In CASA
flagdata(vis='SN2010FZ_flagged10s.ms', scan='7', flagbackup=False)
#
clearcal('SN2010FZ_flagged10s.ms')
#
chanStr = '0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59'
#
setjy(vis='SN2010FZ_flagged10s.ms', field='2', scalebychan=True, \
      modimage='/usr/local/casapy-3.3.0/data/nrao/VLA/CalModels/3C286_C.im')
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G0.2',field='2',spw=chanStr, \
        gaintype='G',refant='ea02',calmode='p',solint='int',minsnr=3)
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.K0.2',gaintable='calSN2010FZ.G0.2', \
        field='2', spw=chanStr, gaintype='K', \
        refant='ea02', combine='scan', solint='inf', minsnr=3)
#
bandpass(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.B0.2', \
         gaintable=['calSN2010FZ.G0.2','calSN2010FZ.K0.2'], \
         field='2',refant='ea02',solnorm=False, \
         spw=chanStr, 
         bandtype='B', combine='scan', solint='inf', gaincurve=True)
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2'], \
        field='2',refant='ea02',solnorm=F, spw=chanStr, \
        solint='int',gaintype='G',calmode='p')
#
gaincal(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G1.2',
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2'], \
        field='0',refant='ea02',solnorm=F, \
        spw=chanStr, \
        solint='inf',gaintype='G',calmode='p',append=True)
#
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2'], \
        gainfield=['2','2','2'], field='2',refant='ea02',solnorm=F,
        spw=chanStr, \
        solint='inf',gaintype='G',calmode='a',gaincurve=True)
#
gaincal(vis='SN2010FZ_flagged10s.ms', caltable='calSN2010FZ.G2.2', \
        gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2'],\
        gainfield=['2','2','0'], field='0',refant='ea02',solnorm=F, \
        spw=chanStr, \
        solint='inf',gaintype='G',calmode='a',gaincurve=True,append=True)
#
fluxscale(vis='SN2010FZ_flagged10s.ms',caltable='calSN2010FZ.G2.2', \
          fluxtable='calSN2010FZ.F2.2',reference='2',transfer='0')
#
applycal(vis='SN2010FZ_flagged10s.ms',field='2', \
         gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2','calSN2010FZ.F2.2'], \
         gainfield=['','','2','2'],interp=['nearest','nearest','linear','nearest'], \
         parang=False,calwt=F,gaincurve=T)
#
applycal(vis='SN2010FZ_flagged10s.ms',field='0', \
         gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2','calSN2010FZ.F2.2'], \
         gainfield=['','','0','0'], interp=['nearest','nearest','nearest','nearest'], \
         parang=False,calwt=F,gaincurve=T)
#
applycal(vis='SN2010FZ_flagged10s.ms',field='1', \
         gaintable=['calSN2010FZ.K0.2','calSN2010FZ.B0.2','calSN2010FZ.G1.2','calSN2010FZ.F2.2'], \
         gainfield=['','','0','0'], interp=['nearest','nearest','linear','linear'], \
         parang=False,calwt=F,gaincurve=T)
#
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       spw=chanStr, \
       correlation='RR,LL',avgbaseline=True,avgtime='60000s',
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

Note that we have set the variable chanStr for our channel selection; this makes the task commands shorter and easier to read.

The source spectrum plot now looks much better:

plotms cal applied flagged fld0 amp averaged
# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',avgbaseline=True,avgtime='60000s',
       xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

We can also plot the corrected phase - looks good:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',xaxis='frequency',yaxis='phase',ydatacolumn='corrected')

We can average over baseline and each scan:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='0', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',avgbaseline=True,avgtime='600s',
       xaxis='frequency',yaxis='phase',ydatacolumn='corrected')
plotms cal applied flagged fld0 phase averaged

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.

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. For example:

# In CASA
plotms(vis='SN2010FZ_flagged10s.ms',field='1',avgtime='300s', \
       spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
       correlation='RR,LL',xaxis='frequency',yaxis='amp',ydatacolumn='corrected')

Alas, the upper baseband still has lots of low level RFI.

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.

# In CASA
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_split10s.ms', \
      datacolumn='corrected',field='1',spw='0~11')
#
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_3c28610s.ms', \
      datacolumn='corrected',field='2',spw='0~11')
#
split(vis='SN2010FZ_flagged10s.ms',outputvis='SN2010FZ_J092510s.ms', \
      datacolumn='corrected',field='0',spw='0~11')

Imaging

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 Observational Status Summary:

  • Synthesized beam should be 12" at 6 GHz with primary beam field of view of 7.5 arcmin (450")

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. We want to subsample the synthesized beam by a factor of ~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.

We will also use the Briggs robust (with robust=0.5) weighting, which is a compromise between uniform and natural weighting, and will give reasonable resolution but will allow us to still see larger scale structure.

Due to the numerology of FFTW's (which clean uses under the hood for FFTs) optimal sizes, imsize should be composite number with two and only two prime factors chosen from 2, 3, and 5. Taking into account the x1.2 padding that clean uses internally to the imsize you give it (and 1.2 = 2*3/5), we choose 640 or 1280 as our imsize (640 = 2^7*5). Other reasonable sets would be 405, 1215, etc. (405 = 3^4*5) or 432, 648, 1296 (these are 2^n*3^m*5). In practice, if you give it non-optimal values for imsize, you may find that the transforms take a bit longer, which is noticeable if you are doing interactive clean.

WARNING: By default, a single-field nterms=1 clean does NOT use Cotton-Schwab (CS) clean to break into major cycles going back to data residuals, it just does cleaning in a bunch of minor cycles in the image plane. This can give much poorer imaging quality in cases with poor uv coverage (snapshots) or in the case of complex emission structure (like ours) -- clean tends to diverge in this case. You should explicitly set imagermode='csclean' in your call to clean. Also, in our case the psf is very good using mfs, so by default it will not take many major cycle breaks. We use the cyclefactor parameter to control this, which sets the break threshold to be cyclefactor times the max psf sidelobe level (outside the main peak). We start at cyclefactor=1.5 in a single spw, and ratchet it up to 4.5 when we clean all the spw. This seems to work ok. Rule of thumb is if it is gobbling up many hundreds of clean iterations in the minor cycles early on, increase cyclefactor. Conversely, if your psf is poor but you source structure is simple, you can reduce cyclefactor (e.g. below 1) to stop it from taking lots of extra major cycles.

For more information on using clean, in particular on using the interactive GUI, see EVLA_Continuum_Tutorial_3C391#Imaging.

NOTE: If you are pressed for time, then you might want to jump ahead to EVLA_6-cm_Wideband_Tutorial_SN2010FZ_(Caltech)#Cleaning_the_lower_baseband_using_two_MFS_Taylor_terms and while it is cleaning you can read the other Imaging descriptions.

Cleaning a single spectral window

Let us start by interactively cleaning one of the lower baseband spw (spw 5 in this example). NOTE: this first time will take a few minutes at start to create scratch columns in the MS in case we want to do self-calibration later.

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.

clean spw5 640x640
clean spw5 1280x1280 before clean
clean spw5 1280x1280 restored image
# In CASA
clean(vis='SN2010FZ_split10s.ms',spw='5:4~59', \
      imagename='imgSN2010FZ10s_spw5_clean640', \
      mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \
      psfmode='clark',imsize=[640,640],cell=['3.0arcsec'],stokes='I', \
      imagermode='csclean', cyclefactor=1.5, \
      weighting='briggs',robust=0.5,calready=True,interactive=True)
  • Start carefully by boxing the bright source and setting iterations to 10 at first
  • Gradually add more boxes and increase the number of iterations
  • Since this is not much more than a snapshot you see the six-fold sidelobe pattern

of the extended emission in the center of the map. This decreases as you clean out this emission.

  • Stop cleaning when the residuals look like noise (and you cannot clearly see sources).
  • To stop, click the red button.

The top figure to the right shows a zoom in on the end state of the clean, where we have marked a number of boxes and cleaned them out.

Note that there are some strange sidelobe patterns in lower left, possibly from a source outside the image area. We can make a bigger image starting from our current model:

# In CASA
clean(vis='SN2010FZ_split10s.ms',spw='5:4~59', \
      imagename='imgSN2010FZ10s_spw5_clean1280', \
      mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \
      psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \
      imagermode='csclean', cyclefactor=1.5, \
      modelimage='imgSN2010FZ10s_spw5_clean640.model', \
      weighting='briggs',robust=0.5,calready=True,interactive=True)

Sure enough, there is a bright source near the lower left (see middle panel at right). Box it, clean it a bit, and look again. There is a second source in the mid-left (track it down by its sidelobes). Box this one, clean it a bit, and when satisfied stop.

You can use the CASA viewer to display the images that clean creates. If you need more guidance on using the viewer, see the CASA Viewer Demo video. For now, just bring up your restored image directly:

# In CASA
viewer('imgSN2010FZ10s_spw5_clean1280.image')

The restored image is shown in the bottom panel to the right. I have chosen the Grayscale1 instead of default color map as I prefer grayscale to false color for assessing image quality. Also, you can change the scaling of the image using the "scaling power cycles" slider under "basic settings".

Check the rms of the residuals using the imstat task:

# In CASA
mystat = imstat('imgSN2010FZ10s_spw5_clean1280.residual')
print 'Residual standard deviation = '+str(mystat['sigma'][0])

In this particular case, it's 31.8 uJy; yours will likely be slightly different.

Cleaning the lower baseband

clean spw0-7 restored image center

Now, image the entire lower baseband (spw 0-7). Follow same iterative procedure as before, and get the best residuals you can without "cleaning the noise".

  • Because of the bandwidth and frequency synthesis, the sidelobe pattern is different than before and it is much easier to see fainter emission.
  • Be careful cleaning sources that lie near or on sidelobe splotches.
  • Clean the central emission region way down first to reduce the sidelobe level before adding components in the sidelobe areas.
# In CASA
clean(vis='SN2010FZ_split10s.ms',spw='0:16~59,1~6:4~59,7:4~54', \
      imagename='imgSN2010FZ10s_spw0to7_clean1280', \
      mode='mfs',nterms=1,niter=10000,gain=0.1,threshold='0.0mJy', \
      psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \
      imagermode='csclean', cyclefactor=1.5, \
      weighting='briggs',robust=0.5,calready=True,interactive=True)
#
mystat = imstat('imgSN2010FZ10s_spw0to7_clean1280.residual')
print 'Residual standard deviation = '+str(mystat['sigma'][0])

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.

Cleaning the lower baseband using two MFS Taylor terms

The mfs nterms=2 option creates two "Taylor Term" images - an average intensity image (with suffix .image.tt0) and a spectral slope image (with suffix .image.tt1) which is intensity x alpha (where alpha is spectral index). For convenience there is a spectral index image (with suffix .image.alpha). 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 reffreq parameter in clean). The convention for spectral index alpha is that

[math]\displaystyle{ S \propto \nu^\alpha }[/math]

so negative spectral indexes indicate a "steep" spectrum (falling with frequency).

clean spw0-7 mfs nterms=2 in progress
clean spw0-7 mfs nterms=2 tt0 and alpha

Let's try using multi-frequency synthesis with nterms=2 on the lower baseband. The dirty beam will have lower sidelobes so we turn up cyclefactor for csclean a bit. Note: if you're feeling a bit lazy, and trust your previous set of clean boxes, you can also set mask='imgSN2010FZ10s_spw0to7_clean1280.mask' to use these as a starting point:

# In CASA
clean(vis='SN2010FZ_split10s.ms',spw='0:16~59,1~6:4~59,7:4~54', \
      imagename='imgSN2010FZ10s_spw0to7_mfs2_clean1280', \
      mode='mfs',nterms=2,niter=10000,gain=0.1,threshold='0.0mJy', \
      psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \
      imagermode='csclean', cyclefactor=4.5, \
      weighting='briggs',robust=0.5,calready=True,interactive=True)
#
mystat = imstat('imgSN2010FZ10s_spw0to7_mfs2_clean1280.residual.tt0')
print 'Residual standard deviation = '+str(mystat['sigma'][0])

For this run, the rms is 10.5 uJy (somewhat better-looking than the nterms=1). The top screenshot to the right shows an intermediate but early stage of cleaning where we are looking at the central emission and cleaning it out slowly.

You can use the viewer to load the average intensity image:

# In CASA
viewer('imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.tt0')

and then use the Open Data panel to load the spectral index image imgSN2010FZ10s_spw0to7_mfs2_clean1280.image.alpha which can then be blinked (optionally plotted side-by-side using the Panel Display Options panel to set 2 panels in the x direction).


Cleaning using both basebands combined

For the ultimate image, use the "clean" part of the upper baseband in addition to the lower (use spw 0-11). We will use mfs with nterms=2 (if you try nterms=1 on this wide bandwidth you will get much poorer residuals). Because of the added work and extra data involved, this will take much longer than our other runs of clean. Therefore, we will get a head start by doing a non-interactive clean using the mask left from the previous clean (spw 0-7). We will insert a clean threshold to limit runaway cleaning too far beneath the noise level.

This will take a while, especially if there are other processes running on your machine (with nothing else running, expect ~30-40 minutes).

# In CASA
clean(vis='SN2010FZ_split10s.ms', \
      spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
      imagename='imgSN2010FZ10s_spw0to11_mfs2_clean1280', \
      mode='mfs',nterms=2,niter=3000,gain=0.1,threshold='0.002mJy', \
      psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \
      imagermode='csclean', cyclefactor=4.5, \
      mask=['imgSN2010FZ10s_spw0to7_mfs2_clean1280.mask'], \
      weighting='briggs',robust=0.5,calready=True,interactive=False)
#
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.residual.tt0')
print 'Residual standard deviation = '+str(mystat['sigma'][0])

For this particular run, the rms was 8.9 uJy (noticeably better than the lower baseband only results).

final residual and mask

Let us see if there is more to clean. Bring this up in interactive mode:

# In CASA
clean(vis='SN2010FZ_split10s.ms', \
      spw='0:16~59,1~6:4~59,7:4~54,8:30~59,9~10:4~59,11:4~19;21~59', \
      imagename='imgSN2010FZ10s_spw0to11_mfs2_clean1280', \
      mode='mfs',nterms=2,niter=3000,gain=0.1,threshold='0.001mJy', \
      psfmode='clark',imsize=[1280,1280],cell=['3.0arcsec'],stokes='I', \
      imagermode='csclean', cyclefactor=4.5, \
      weighting='briggs',robust=0.5,calready=True,interactive=True)

You might find a few more sources revealed in the outer parts of the image, and also more emission around the galaxy disk in the center. Try drawing new boxes, perhaps extend the box in the center, and do ~100-1000 more iterations. At the end, what is left should be dominated by the error patterns from mis-calibration. Only self-calibration will get rid of these. Stop cleaning for now. See the figure to the right for the interactive display panel showing final residuals and mask (changing the colormap to Greyscale 1).

Check the residual levels:

# In CASA
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.residual.tt0')
sigma = mystat['sigma'][0]
print 'Residual standard deviation = '+str(mystat['sigma'][0])

The final rms achieved here is 8.6 uJy; slightly better.

Analyzing the image and comparing with the Optical/Infrared

Let's see how close we got to expected noise and dynamic range:

# In CASA
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0')
peak = mystat['max'][0]
print 'Image max flux = '+str(mystat['max'][0])
#
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.model.tt0')
total = mystat['sum'][0]
print 'Model total flux = '+str(mystat['sum'][0])
#
snr = peak/sigma
print 'SN2010FZ peak S/N = '+str(snr)
#
snr = total/sigma
print 'SN2010FZ total S/N = '+str(snr)

The output gives:

Residual standard deviation = 8.60710739215e-06
Image max flux = 0.00995589420199
Model total flux = 0.0371581438531
SN2010FZ peak S/N = 1156.70616717
SN2010FZ total S/N = 4317.14653485

What do we expect? If we do listobs on this MS we see the scans:

  Date        Timerange (UTC)          Scan  FldId FieldName           nRows   Int(s)   
  11-Jul-2010/21:38:44.0 - 21:39:51.0     9      0 SN2010FZ            33696  9.16     
              21:40:01.0 - 21:41:20.5    10      0 SN2010FZ            37908  9.89     
              21:41:30.0 - 21:42:50.0    11      0 SN2010FZ            37908  10       
              21:43:00.0 - 21:44:20.0    12      0 SN2010FZ            37908  10       
              21:44:30.0 - 21:45:50.0    13      0 SN2010FZ            37908  10       
              21:46:00.0 - 21:47:19.5    14      0 SN2010FZ            37908  9.89     
              21:47:29.0 - 21:47:49.0    15      0 SN2010FZ            12636  9.67     
              21:49:42.0 - 21:50:49.0    17      0 SN2010FZ            33696  9.17     
              21:50:59.0 - 21:52:19.0    18      0 SN2010FZ            37908  10       
              21:52:29.0 - 21:53:48.5    19      0 SN2010FZ            37908  9.89     
              21:53:58.0 - 21:55:18.0    20      0 SN2010FZ            37908  10       
              21:55:28.0 - 21:56:48.0    21      0 SN2010FZ            37908  10       
              21:56:58.0 - 21:58:18.0    22      0 SN2010FZ            37908  10       
              21:58:28.0 - 21:58:47.5    23      0 SN2010FZ            12636  9.67     
              22:00:39.5 - 22:01:47.0    25      0 SN2010FZ            33696  9.18     
              22:01:57.0 - 22:03:17.0    26      0 SN2010FZ            37908  10       
              22:03:27.0 - 22:04:47.0    27      0 SN2010FZ            37908  10       
              22:04:57.0 - 22:06:16.5    28      0 SN2010FZ            37908  9.89     
              22:06:26.0 - 22:07:46.0    29      0 SN2010FZ            37908  10       
              22:07:56.0 - 22:09:16.0    30      0 SN2010FZ            37908  10       
              22:09:26.0 - 22:09:45.5    31      0 SN2010FZ            12636  9.67     
              22:11:38.0 - 22:12:45.5    33      0 SN2010FZ            33696  9.19     
              22:12:55.0 - 22:14:15.0    34      0 SN2010FZ            37908  10       
              22:14:25.0 - 22:15:45.0    35      0 SN2010FZ            37908  10       
              22:15:55.0 - 22:17:15.0    36      0 SN2010FZ            37908  10       
              22:17:25.0 - 22:18:44.5    37      0 SN2010FZ            37908  9.89     
              22:18:54.0 - 22:20:14.0    38      0 SN2010FZ            37908  10       
              22:20:24.0 - 22:20:43.5    39      0 SN2010FZ            12636  9.67     
           (nVis = Total number of time/baseline visibilities per scan) 

(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 into the 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).

final image

Look at this in the viewer:

# In CASA
viewer('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0')

Zoom in on the center (see figure to the right).

final tt1 image with box

In the previous section we demonstrated how to process and display the spectral index image. You can do the same for this final image. Here, we will do some rough analysis on the spectral index to determine an intensity-weighted mean spectral index over the core region. The .image.tt1 from our mfs is an intensity times alpha image. See the figure to the right. Let's gate the Taylor-term images on intensity:

# In CASA
immath(imagename=['imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1',
                  'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'],
       mode='evalexpr',
       expr='IM0[IM1>5.0E-5]',
       outfile='imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered')
#
immath(imagename=['imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'],
       mode='evalexpr',
       expr='IM0[IM0>5.0E-5]',
       outfile='imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered')

We can identify a box containing the central emission (see figure of tt1 in viewer) and note the corners. (We could also use the region tools from the viewer, but that is for another exercise.) Let us compute the intensity-weighted spectral index over this box by averaging these masked images using imstat and computing the ratio:

# In CASA
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt1.filtered',
                box='503,533,756,762')
avgtt0alpha = mystat['mean'][0]
#
mystat = imstat('imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0.filtered',
                box='503,533,756,762')
avgtt0 = mystat['mean'][0]
avgalpha = avgtt0alpha/avgtt0
print 'SN2010FZ I-weighted Alpha = '+str(avgalpha)

We get

SN2010FZ I-weighted Alpha = -1.38157453384

The emission in this source is on the steep side. At this point we do not know how reliable this is or what we expect (though our calibrators come out with correct spectral indexes if we image them the same way). But this illustrates a way to extract spectral information from our wideband mfs images.

As a final comparison, we turn to the Sloan Digital Sky Survey (SDSS) and a cutout image of our galaxy:

from their RC3 album (courtesy D.Hogg, M.Blanton, SDSS collaboration - see #Credits). This looks like a nice nearby face-on spiral galaxy. How does our 6cm continuum emission line up with the optical?

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:

final and sdss image

You can also find this image (at the CASA workshop, it's in /data/casa/evla/NGC_2967_UGC_5180_IRAS_09394+0033-i.fits) and load it into your viewer, and blink against our 6cm image.

We can also plot one as a raster and the other overlaid as contours. You can load the SDSS image from the viewer Load Data panel and fiddle with contours. Once you know contour levels, you can also use the imview task to load a raster and contour image:

# In CASA
imview(raster={ 'file' : 'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0'},
       contour = { 'file' : 'NGC_2967_UGC_5180_IRAS_09394+0033-i.fits',
                   'levels' : [0.2, 0.5, 1, 1.5, 3],
                   'base' : 0.0,
                   'unit' : 1.0 } )

The figure below shows the SDSS contours overlaid on our 6cm image (after fiddling with the colormap shift/slope for the EVLA raster image).

6cm EVLA raster plus SDSS i-band contours

Likewise, we can plot the SDSS image as a raster and overlay EVLA 6cm contours:

# In CASA
imview(raster={ 'file' : 'NGC_2967_UGC_5180_IRAS_09394+0033-i.fits',
                'scaling' : -2.0,
                'range' : [0,10] },
       contour = { 'file' : 'imgSN2010FZ10s_spw0to11_mfs2_clean1280.image.tt0',
                   'levels' : [0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56],
                   'base' : 0.0,
                   'unit' : 0.001 },
       zoom = { 'blc' : [397,300],
                'trc' : [1567,1231] } )

This is shown in the figure below. Is the compact 6cm emission in upper left associated with a spiral arm?

SDSS i-band raster plus EVLA 6cm contours

What to do next: some exercises for the user

Here are a number of things you can try after completing this tutorial:

  1. Use self-calibration to improve the data and re-clean to make a better image. See this tutorial for more information on self-calibration.
  2. Use multi-scale clean by adding non-zero scales to the multiscale parameter.
  3. 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)?
  4. Try the testautoflag task (in 3.3.0 and later) to automatically flag RFI from the upper sideband. There is more information on running testautoflag in this tutorial.

Credits

The EVLA data was taken by A. Soderberg et al. as part of project AS1015. See NRAO eNews 3.8 (1-Sep-2010) for more on this result.

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).

The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.

SDSS image courtesy David Hogg & Michael Blanton, private communication. Data comes from SDSS DR7, see Abazajian et. al 2009.

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 [1].

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.