VLA Data Combination-W49A-CASA6.2.0: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Jott (talk | contribs)
Akimball (talk | contribs)
 
(48 intermediate revisions by 2 users not shown)
Line 5: Line 5:
A perfect image requires measurement of all spatial scales, which is equivalent to filling in the complete uv plane. Unfortunately, this can never be achieved with an aperture synthesis interferometer, although a large number of baselines, long integration times, and multi-frequency-synthesis are all good approaches to increase the uv-coverage. One method to obtain more baselines is to observe in different array configurations and to combine the data afterwards. Deconvolution algorithms are then given good starting conditions to interpolate across the gaps in the uv-plane to achieve an image that combines the surface brightness sensitivity of the compact baselines with the spatial resolution of the extended baselines.  
A perfect image requires measurement of all spatial scales, which is equivalent to filling in the complete uv plane. Unfortunately, this can never be achieved with an aperture synthesis interferometer, although a large number of baselines, long integration times, and multi-frequency-synthesis are all good approaches to increase the uv-coverage. One method to obtain more baselines is to observe in different array configurations and to combine the data afterwards. Deconvolution algorithms are then given good starting conditions to interpolate across the gaps in the uv-plane to achieve an image that combines the surface brightness sensitivity of the compact baselines with the spatial resolution of the extended baselines.  


The VLA can be configured into [https://go.nrao.edu/vla-res four principal array configurations], A, B, C, and D; A is the most extended and D is the most compact configuration. Consequently, A configuration data exhibit the highest spatial resolution whereas D configuration delivers the best surface brightness sensitivity and also images the largest scales of the sky brightness distribution.  
The VLA can be configured into [https://go.nrao.edu/vla-res four principal array configurations]: A, B, C, and D. The A configuration is the most extended, and D is the most compact configuration. Consequently, A-configuration data exhibit the highest spatial resolution whereas D-configuration delivers the best surface brightness sensitivity and also images the largest scales of the sky brightness distribution.  


In this tutorial, we will combine data from three VLA configurations (A, B, and C) that were obtained in a monitoring campaign of Sgr A*, the central supermassive black hole of our Milky Way.
In this tutorial, we will combine data from all four VLA configurations (A, B, C, and D) that were observed in X-band continuum toward W49A, a massive star forming region in the Milky Way.


== Typical Observing Times ==
== Typical Observing Times ==
Line 20: Line 20:
== The Data ==
== The Data ==


We will be combining three different datasets, S-band A, B, and C configuration data, from the [https://science.nrao.edu/science/service-observing NRAO Monitoring of the Galactic Center/G2 Cloud Encounter]. The data were all calibrated and the science target [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.split.html split] out.  
We will be combining four different datasets, X-band A, B, C, and D configuration data. The data were all calibrated and the science target [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.split.html split] out.  


  The calibrated measurement sets can be downloaded here:  
  The calibrated measurement sets can be downloaded here:  
  [https://casa.nrao.edu/Data/EVLA/SgrA/VLA-combination-SgrA-files.tar.gz https://casa.nrao.edu/Data/EVLA/SgrA/VLA-combination-SgrA-files.tar.gz] (1.4GB)
  [https://casa.nrao.edu/Data/EVLA/combination/VLA-combination-W49A.tar.gz https://casa.nrao.edu/Data/EVLA/combination/VLA-combination-W49A.tar.gz] (3.0G)




Line 30: Line 30:
<pre style="background-color: lightgrey;”>
<pre style="background-color: lightgrey;”>
# In a Terminal
# In a Terminal
tar -xzvf VLA-combination-SgrA-files.tar.gz
tar -xzvf VLA-combination-W49A.tar.gz
</pre>
</pre>


This will unpack three MeasurementSets (MSs), one for each array configuration:  
This will unpack four MeasurementSets (MSs), one for each array configuration:  


<pre>
<pre>
VLA-SgrA-Sband-Aconfig.ms
A-W49A.ms
 
B-W49A.ms
VLA-SgrA-Sband-Bconfig.ms
C-W49A.ms
 
D-W49A.ms
VLA-SgrA-Sband-Cconfig.ms
</pre>
</pre>


Line 58: Line 57:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
listobs(vis='VLA-SgrA-Sband-Aconfig.ms')
listobs(vis='A-W49A.ms')
</source>
</source>


<pre>
<pre>
##########################################
  ##########################################
##### Begin Task: listobs            #####
  ##### Begin Task: listobs            #####
listobs(vis="VLA-SgrA-Sband-Aconfig.ms",selectdata=True,spw="",field="",antenna="",
  listobs( vis='A-W49A.ms', selectdata=True, spw='', field='', antenna='', uvrange='', timerange='', correlation='', scan='', intent='', feed='', array='', observation='', verbose=True, listfile='', listunfl=False, cachesize=50.0, overwrite=False )
        uvrange="",timerange="",correlation="",scan="",intent="",
  ================================================================================
        feed="",array="",observation="",verbose=True,listfile="",
            MeasurementSet Name:  /lustre/aoc/sciops/jott/casa/combination-2021/data/vis-small3/A-W49A.ms      MS Version 2
        listunfl=False,cachesize=50,overwrite=False)
  ================================================================================
================================================================================
    Observer: Dr. Chris De Pree     Project: uid://evla/pdb/30105074
          MeasurementSet Name:  /lustre/aoc/sciops/jott/casa/topicalguide/combination/test/VLA-SgrA-Sband-Aconfig.ms      MS Version 2
  Observation: EVLA
================================================================================
  Computing scan and subscan properties...
  Observer: lorant sjouwerman     Project: uid://evla/pdb/11434214 
  Data records: 764478       Total elapsed time = 8973 seconds
Observation: EVLA
    Observed from  24-Jun-2015/07:32:30.0  to  24-Jun-2015/10:02:03.0 (UTC)
Data records: 528000       Total elapsed time = 360 seconds
 
  Observed from  31-May-2014/09:07:57.0  to  31-May-2014/09:13:57.0 (UTC)
    ObservationID = 0        ArrayID = 0
Compute subscan properties
    Date        Timerange (UTC)          Scan  FldId FieldName            nRows    SpwIds  Average Interval(s)    ScanIntent
 
    24-Jun-2015/07:32:30.0 - 07:42:24.0     4     0 W49A                    69498 [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
  ObservationID = 0        ArrayID = 0
                07:42:27.0 - 07:47:24.0    5      0 W49A                    34749  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
  Date        Timerange (UTC)          Scan  FldId FieldName            nRows    SpwIds  Average Interval(s)    ScanIntent
                07:49:27.0 - 07:59:21.0    7     0 W49A                    69498  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
  31-May-2014/09:07:57.0 - 09:13:57.0   63     0 J1745-2900              528000 [0,3,4,5,6,7,8,9,10,11,12,13,14,15]  [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3] [OBSERVE_TARGET#UNSPECIFIED]
                07:59:24.0 - 08:04:21.0     8      0 W49A                    34749  [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
          (nRows = Total number of rows per scan)
                08:06:24.0 - 08:16:18.0    10      0 W49A                    69498 [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
Fields: 1
                08:16:21.0 - 08:21:18.0    11      0 W49A                    34749 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  ID  Code Name                RA              Decl          Epoch  SrcId     nRows
                08:23:21.0 - 08:33:18.0   13      0 W49A                    69849 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  0   NONE J1745-2900          17:45:40.038300 -29.00.28.06899 J2000  0         528000
                08:33:21.0 - 08:38:15.0   14      0 W49A                    34398 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
Spectral Windows: (14 unique spectral windows and 1 unique polarization setups)
                08:40:18.0 - 08:50:15.0   16      0 W49A                    69849 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  SpwID Name          #Chans  Frame  Ch0(MHz)  ChanWid(kHz)  TotBW(kHz) CtrFreq(MHz) BBC Num Corrs  
                08:50:18.0 - 08:55:12.0   17      0 W49A                    34398 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  0      EVLA_S#A0C0#80    64  TOPO    1988.000      2000.000   128000.0   2051.0000      12 RR LL
                08:57:15.0 - 09:07:12.0   19     0 W49A                    69849 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  3     EVLA_S#A0C0#83    64  TOPO    2372.000      2000.000   128000.0   2435.0000      12 RR LL
                09:07:15.0 - 09:12:09.0   20      0 W49A                    34398 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  4      EVLA_S#A0C0#84    64  TOPO    2500.000      2000.000   128000.0   2563.0000      12 RR LL
                09:40:09.0 - 09:50:03.0   25      0 W49A                    69498 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  5      EVLA_S#A0C0#85    64  TOPO    2628.000      2000.000   128000.0   2691.0000      12 RR LL
                09:50:06.0 - 09:55:03.0    26      0 W49A                    34749 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  6      EVLA_S#A0C0#86    64  TOPO    2756.000      2000.000    128000.0   2819.0000      12  RR  LL
                09:57:06.0 - 10:02:03.0   28      0 W49A                    34749 [0] [3] [OBSERVE_TARGET#UNSPECIFIED]
  7      EVLA_S#A0C0#87    64  TOPO   2884.000     2000.000    128000.0   2947.0000      12 RR LL
            (nRows = Total number of rows per scan)
  8      EVLA_S#B0D0#88    64  TOPO    2988.000      2000.000   128000.0   3051.0000      15 RR LL
   Fields: 1
  9      EVLA_S#B0D0#89    64  TOPO    3116.000      2000.000   128000.0   3179.0000      15 RR LL
     ID   Code Name                RA              Decl          Epoch  SrcId      nRows
  10    EVLA_S#B0D0#90    64  TOPO    3244.000      2000.000    128000.0   3307.0000      15 RR LL
    0    NONE W49A                19:10:12.930999 +09.06.11.88200 J2000  0        764478
  11    EVLA_S#B0D0#91    64  TOPO    3372.000      2000.000   128000.0   3435.0000      15 RR LL
  Spectral Windows: (1 unique spectral windows and 1 unique polarization setups)
   12     EVLA_S#B0D0#92    64   TOPO    3500.000      2000.000    128000.0  3563.0000      15 RR  LL
     SpwID  Name          #Chans   Frame   Ch0(MHz) ChanWid(kHz) TotBW(kHz) CtrFreq(MHz) BBC Num  Corrs
  13     EVLA_S#B0D0#93    64   TOPO    3628.000      2000.000    128000.0   3691.0000      15 RR LL
     0      EVLA_X#B0D0#11     64  TOPO    8372.479     2000.000    128000.0  8435.4793       15  RR  LL
  14     EVLA_S#B0D0#94     64  TOPO    3756.000     2000.000    128000.0  3819.0000       15  RR  LL
   Sources: 1
   15     EVLA_S#B0D0#95    64   TOPO    3884.000      2000.000    128000.0  3947.0000      15  RR  LL
     ID   Name                SpwId RestFreq(MHz)  SysVel(km/s)
Sources: 16
    0    W49A                0     9816.865      8
  ID  Name                SpwId RestFreq(MHz)  SysVel(km/s)  
   Antennas: 27:
  0    J1745-2900          0     -              -           
     ID  Name  Station   Diam.   Long.        Lat.                Offset from array center (m)                ITRF Geocentric coordinates (m)
   0    J1745-2900          1     -              -           
                                                                      East        North    Elevation              x              y              z
   0   J1745-2900          2     -              -           
     0    ea01  N64      25.0 m   -107.37.58.7  +34.02.20.5      -1382.3871   15410.1384      -40.6410 -1599855.687000 -5033332.368600  3567636.613800
  0    J1745-2900          3    -              -           
    1    ea02  N16      25.0 m   -107.37.10.9  +33.54.48.0       -155.8524     1426.6393      -9.3842 -1601061.957600 -5041175.881400  3556058.033100
   0    J1745-2900          4    -             -           
    2    ea03  W48      25.0 m   -107.42.44.3  +33.50.52.1      -8707.9476   -5861.7878      15.5283 -1610451.932800 -5042471.123800  3550021.055800
  0   J1745-2900          5    -             -          
    3   ea04  E40      25.0 m   -107.32.35.4  +33.52.16.9      6908.8199   -3240.7429      39.0197 -1595124.937100 -5045829.476200  3552210.683600
  0   J1745-2900          6    -              -           
    4   ea05  E72      25.0 m   -107.24.42.3 +33.49.18.0      19041.8648    -8769.1806       4.7639 -1584460.883200 -5052385.614800  3547600.041100
   0    J1745-2900          7    -              -           
    5   ea06 N40       25.0 m  -107.37.29.5 +33.57.44.4       -633.6056     6878.6057     -20.7877 -1600592.749000 -5038121.341300 3560574.846200
  0   J1745-2900          8     -             -          
    6   ea07 N72       25.0 m  -107.38.10.5 +34.04.12.2     -1685.6797   18861.8360     -43.4978 -1599557.928700 -5031396.353400 3570494.743400
   0    J1745-2900          9    -              -           
    7   ea08 E64      25.0 m  -107.27.00.1  +33.50.06.7      15507.6019   -7263.7123       67.2037 -1587600.192200 -5050575.870700 3548885.413900
  0    J1745-2900          10   -             -          
    8   ea09 W08       25.0 m  -107.37.21.6 +33.53.53.0       -432.1156    -272.1458       -1.4994 -1601614.091200 -5042001.656900 3554652.514300
  0    J1745-2900          11   -              -           
    9   ea10 E32       25.0 m  -107.34.01.5 +33.52.50.3       4701.6612    -2209.7048       25.2200 -1597053.118400 -5044604.692200 3553059.011100
   0    J1745-2900          12   -             -          
    10   ea11 W24       25.0 m  -107.38.49.0 +33.53.04.0     -2673.3543   -1784.5861      10.4723 -1604008.747100 -5042135.805100 3553403.716300
  0    J1745-2900          13   -              -           
    11   ea12 N32       25.0 m  -107.37.22.0 +33.56.33.6       -441.7251     4689.9820     -16.9255 -1600781.044100 -5039347.437000 3558761.543300
  0   J1745-2900          14    -              -           
    12   ea13 W16       25.0 m  -107.37.57.4 +33.53.33.0     -1348.7131     -890.6107        1.2990 -1602592.853500 -5042054.989100 3554140.713000
   0    J1745-2900          15    -              -           
    13   ea14 E08       25.0 m  -107.36.48.9 +33.53.55.1        407.8280     -206.0296      -3.2233 -1600801.931400 -5042219.381700 3554706.431200
Antennas: 26:
    14   ea15 E24       25.0 m  -107.35.13.4  +33.53.18.1       2858.1759   -1349.1337       13.7125 -1598663.094300 -5043581.381100 3553767.012000
  ID  Name Station  Diam.   Long.         Lat.               Offset from array center (m)                ITRF Geocentric coordinates (m)        
    15   ea16 W64       25.0 m  -107.46.20.1 +33.48.50.9    -14240.7524   -9606.2900       17.0885 -1616361.575500 -5042770.516600 3546911.419900
                                                                    East        North    Elevation              x              y              z
    16   ea17 N24       25.0 m  -107.37.16.1 +33.55.37.7      -290.3645    2961.8847     -12.2406 -1600930.072900 -5040316.384900 3557330.407200
  0   ea01 N32       25.0 m  -107.37.22.0 +33.56.33.6       -441.7442     4689.9683     -16.9356 -1600781.062100 -5039347.430600 3558761.526300
    17   ea18 W72       25.0 m  -107.48.24.0 +33.47.41.2     -17419.4641  -11760.2694       14.9442 -1619757.299900 -5042937.656400 3545120.392300
  1   ea02 N64       25.0 m  -107.37.58.7 +34.02.20.5     -1382.3632   15410.1417     -40.6233 -1599855.668100 -5033332.388100 3567636.626500
    18   ea19 W40       25.0 m  -107.41.13.5 +33.51.43.1     -6377.9723    -4286.7839        8.2107 -1607962.451800 -5042338.204100 3551324.945500
  2   ea03 E64      25.0 m  -107.27.00.1  +33.50.06.7      15507.5911   -7263.7210       67.2006 -1587600.203200 -5050575.869700 3548885.404900
    19   ea20 N48       25.0 m  -107.37.38.1  +33.59.06.2      -855.2671    9405.9613     -25.9164 -1600374.881000 -5036704.217500 3562667.893900
  3   ea04 E24       25.0 m  -107.35.13.4 +33.53.18.1       2858.1804    -1349.1324       13.7306 -1598663.094300 -5043581.396100 3553767.023200
    20   ea21 E56       25.0 m  -107.29.04.1 +33.50.54.9      12327.6481   -5774.7445       42.6332 -1590380.599000 -5048810.261300 3550108.444300
  4   ea05 W08       25.0 m  -107.37.21.6 +33.53.53.0       -432.1181    -272.1470       -1.5057 -1601614.092200 -5042001.651900 3554652.509800
    21   ea23 E16       25.0 m  -107.36.09.8 +33.53.40.0       1410.0345    -673.4704      -0.7961 -1599926.106100 -5042772.964400 3554319.787600
   5    ea06 N56       25.0 m  -107.37.47.9 +34.00.38.4     -1105.2076   12254.3155      -34.2423 -1600128.382500 -5035104.142000 3565024.679400
    22   ea24 W32       25.0 m  -107.39.54.8 +33.52.27.2     -4359.4410    -2923.1315      11.7693 -1605808.637100
   6    ea07 N48       25.0 m  -107.37.38.1 +33.59.06.2       -855.2644     9405.9610     -25.9303 -1600374.875000 -5036704.207500 3562667.885900
    23   ea25 W56       25.0 m  -107.44.26.7 +33.49.54.6    -11333.1991    -7637.6832      15.3636 -1613255.391400 -5042613.097800 3548545.906000
   7    ea08 N16       25.0 m  -107.37.10.9 +33.54.48.0       -155.8517     1426.6442      -9.3792 -1601061.957400 -5041175.883000 3556058.040000
    24   ea26 E48      25.0 m  -107.30.56.1  +33.51.38.4      9456.6036   -4431.6334       37.9266 -1592894.077600 -5047229.118200 3551221.221000
   8    ea09 W64       25.0 m  -107.46.20.1 +33.48.50.9     -14240.7638    -9606.2696      17.1066 -1616361.587500 -5042770.516600 3546911.446900
    25   ea27 N08       25.0 m  -107.37.07.5 +33.54.15.8        -68.9101      433.1984      -5.0732 -1601147.939700 -5041733.820400 3555235.956600
   9    ea10 E40       25.0 m  -107.32.35.4  +33.52.16.9       6908.8305   -3240.7192       39.0202 -1595124.923100 -5045829.467200 3552210.703600
    26   ea28 N56       25.0 m  -107.37.47.9 +34.00.38.4      -1105.2275    12254.3062      -34.2445 -1600128.402500 -5035104.139200 3565024.670400
   10  ea11 W24       25.0 m  -107.38.49.0 +33.53.04.0      -2673.3552   -1784.5888       10.4757 -1604008.749300 -5042135.808900 3553403.716000
   Result listobs: True
   11  ea12 N09       25.0 m  -107.37.07.8 +33.54.19.0        -77.4204     530.6453      -5.5755 -1601139.471200 -5041679.039700 3555316.553900
   Task listobs complete. Start time: 2021-09-10 10:01:51.648534 End time: 2021-09-10 10:01:51.932094
   12  ea13 W56       25.0 m  -107.44.26.7 +33.49.54.6     -11333.2004    -7637.6771       15.3707 -1613255.393400 -5042613.099800 3548545.915000
   ##### End Task: listobs              #####
   13  ea14 E08       25.0 m  -107.36.48.9 +33.53.55.1       407.8298    -206.0320      -3.2196 -1600801.931000 -5042219.386500 3554706.431200
   ##########################################
   14  ea15 E56       25.0 m  -107.29.04.1  +33.50.54.9     12327.6313    -5774.7469      42.6153 -1590380.611000 -5048810.243300 3550108.432300
 
   15  ea17 E32       25.0 m  -107.34.01.5 +33.52.50.3      4701.6413   -2209.7152       25.2066 -1597053.135800 -5044604.681200 3553058.995000
 
   16  ea18 E72       25.0 m  -107.24.42.3 +33.49.18.0     19041.8717    -8769.2047        4.7262 -1584460.871200 -5052385.599800 3547600.000100
   17  ea19 W16       25.0 m  -107.37.57.4 +33.53.33.0     -1348.7109    -890.6216        1.3005 -1602592.853600 -5042054.996800  3554140.704800
   18  ea20 N40       25.0 m  -107.37.29.5 +33.57.44.4      -633.6074    6878.6018      -20.7693 -1600592.756000 -5038121.357300 3560574.853200
   19  ea21 E48      25.0 m  -107.30.56.1  +33.51.38.4      9456.6097   -4431.6564       37.9341 -1592894.077600 -5047229.138200 3551221.206000
   20  ea22 N24       25.0 m  -107.37.16.1 +33.55.37.7      -290.3752    2961.8594      -12.2389 -1600930.087800 -5040316.396400 3557330.387200
   21  ea23 W72       25.0 m  -107.48.24.0 +33.47.41.2    -17419.4740  -11760.2758      14.9538 -1619757.312900 -5042937.664400 3545120.392300
   22   ea24  W48      25.0 m  -107.42.44.3  +33.50.52.1      -8707.9403    -5861.7877      15.5282 -1610451.925800 -5042471.125800  3550021.055800
   23   ea25  W32      25.0 m  -107.39.54.8  +33.52.27.2      -4359.4392    -2923.1244      11.7721 -1605808.634900 -5042230.089000  3552459.209500
  24  ea26  W40      25.0 m  -107.41.13.5  +33.51.43.1      -6377.9880    -4286.7769        8.2038 -1607962.463800 -5042338.190100  3551324.947500
  25  ea28  E16      25.0 m  -107.36.09.8  +33.53.40.0      1410.0378    -673.4764      -0.7821 -1599926.107500 -5042772.979700  3554319.790400
##### End Task: listobs              #####
##########################################
</pre>  
</pre>  


We see that A-configuration contains only the central source, J1745-2900, which is just a different name for Sgr A*  (the target source has been [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.split.html?highlight=split split] out to remove all calibrators). The on-source integration time amounts to only six minutes and the 14 spectral windows span a frequency range from 1.988 to 4.012GHz. Inspection of the other array configuration files show almost identical setups. Although the integration times between the different array configurations do not follow the 1:3:9 ratios that we discussed in the previous section, we can still combine the data without any problem. In the end, having better signal to noise on the shorter baselines can only improve the overall combined image.  
The data were prepared for this tutorial to contain only one source, W49A, calibrated through the VLA pipeline (although, for the sake of this tutorial, no [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] task has been run, see below). To reduce the size of the files, the MS only contains one spectral window, binned into 64 2MHz channels around 8.4GHz (X-band). We also extracted the calibrated data, discarding the raw data and any model, such that the MS now only contains visibilities in the DATA column. The on-source integration time amounts to about 2.5h. Inspection of the other array configuration files show almost identical setups. Although the integration times between the different array configurations do not follow the 1:3:9:27 ratios that we discussed in the previous section, we can still combine the data without any problem. In the end, having a higher signal to noise ratio on the shorter baselines can only improve the overall combined image.  


To better understand the data, let's check the uv-coverage of each of the three datasets:
To better understand the data, let's check the uv-coverage of each of the four datasets. For faster plotting, we only plot channel 32 near the center of each spectral window. All plots are on the same scale:


<source lang="python">
<source lang="python">
# In CASA
# In CASA
# A-config:  
# A-config:  
plotms(vis='A-spw11.ms',xaxis='Uwave',yaxis='Vwave',spw='0:65')
plotms(vis='A-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])
</source>


<source lang="python">
# In CASA
# B-config
# B-config
plotms(vis='B-spw11.ms',xaxis='Uwave',yaxis='Vwave',spw='0:65')
plotms(vis='B-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])
</source>


<source lang="python">
# In CASA
# C-config:
# C-config:
plotms(vis='C-spw11.ms',xaxis='Uwave',yaxis='Vwave',spw='0:65')
plotms(vis='C-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])
</source>


<source lang="python">
# D-config:
# In CASA
plotms(vis='D-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])
# C-config:
plotms(vis='D-spw11.ms',xaxis='Uwave',yaxis='Vwave',spw='0:65')
</source>
</source>


The uv-coverage plots are shown in Fig. 1a-c. The u:v aspect ratio of each uv-coverage is high as Sgr A* is a very southern source. We also see that the longest baseline in each array differs by about a factor of 3, as expected, between the VLA A, B, and C configurations.  
The uv-coverage plots are shown in Fig. 1a-d using a common scale. The longest baseline in each array differs by about a factor of 3, as expected, between the VLA A, B, C, and D configurations.  




{|
{|
|[[Image:UvAconfig_CASA5.7.png|400px|thumb|left|'''Figure 1a:''' <br />UV-coverage of the A-configuration data.]]
|[[Image:UvAconfigW49A.png|300px|thumb|left|'''Figure 1a:''' <br />UV-coverage of the A-configuration data.]]
|[[Image:UvBconfig_CASA5.7.png|400px|thumb|left|'''Figure 1b:''' <br />UV-coverage of the B-configuration data.]]
|[[Image:UvBconfigW49A.png|300px|thumb|left|'''Figure 1b:''' <br />UV-coverage of the B-configuration data.]]
|[[Image:UvCconfig_CASA5.7.png|400px|thumb|left|'''Figure 1c:''' <br />UV-coverage of the C-configuration data.]]
|[[Image:UvCconfigW49A.png|300px|thumb|left|'''Figure 1c:''' <br />UV-coverage of the C-configuration data.]]
|[[Image:UvDconfigW49A.png|300px|thumb|left|'''Figure 1d:''' <br />UV-coverage of the D-configuration data.]]
|}
|}


The next step is to determine the image quality, the synthesized beam, and the rms of each image. The images do not have to be perfectly deconvolved as we only would like to see how the combination will improve over the individual arrays.  
The next step is to determine the image quality, the synthesized beam, and the rms of each image. The images do not have to be perfectly deconvolved as we only would like to see how the combination will improve over the individual arrays.  


To keep things simple, we will use common cell sizes of 0.1 arcsec, which samples well the A-configuration beam and oversamples the more compact configurations. We create images of 1280 pixels on each side, and we will [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] 1000 iterations (see the [http://casaguides.nrao.edu/index.php/VLA_CASA_Imaging VLA CASA imaging guide] for more sophisticated imaging parameter choices). :
To keep things simple, we will use common cell sizes of 0.05 arcsec, which samples well the A-configuration beam and oversamples the more compact configurations. We create images of 1280 pixels on each side, and we will [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] 1000 iterations (see the [http://casaguides.nrao.edu/index.php/VLA_CASA_Imaging VLA CASA imaging guide] for more sophisticated imaging parameter choices). We move the center of the image to the region with the main emission to avoid having to image a very large field of view:
   
   
<source lang="python">
<source lang="python">
# In CASA
# In CASA
# A-config:  
# A-config:  
tclean(vis='A-W49A.ms',imagename='Aonly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
      robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')
# B-config:
tclean(vis='B-W49A.ms',imagename='Bonly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
      robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')
# C-config:
tclean(vis='C-W49A.ms',imagename='Conly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
      robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')


tclean(vis='A-spw11-W49A.ms',imagename='Aonly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')
# D-config:
tclean(vis='B-spw11-W49A.ms',imagename='Bonly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')
tclean(vis='D-W49A.ms',imagename='Donly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
tclean(vis='C-spw11-W49A.ms',imagename='Conly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')
      robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')  
tclean(vis='D-spw11-W49A.ms',imagename='Donly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')  
</source>
</source>


Line 205: Line 193:




The clean images, shown in Fig. 2a-c, give a first impression of the data. Note that when combining the images, we will improve on the uv-coverage and will therefore not only combine high resolution with high surface brightness sensitivity on large scales, but also expect a higher image fidelity, i.e. fewer artifacts due to better deconvolution.  
The clean images, shown in Fig. 2a-d, give a first impression of the data. Note that when combining the images, we will improve on the uv-coverage and will therefore not only combine high resolution with high surface brightness sensitivity on large scales, but also expect a higher image fidelity, i.e. fewer artifacts due to better deconvolution. In particular, the ripples in the extended configuration data are the typical 'missing short spacing' bowls, that the more compact configurations will fill in to improve the image quality.  


{|
{|
|[[Image:SgrA_AonlyCASA5.5.0.jpeg|400px|thumb|left|'''Figure 2a:''' <br />Simple image of the A-configuration data. To get a similar image, in the Viewer task, click on the Wrench icon and in the Basic setting change the data range to [-0.01, 0.03]]]
|[[Image:AonlyW49A.png|300px|thumb|left|'''Figure 2a:''' <br />Simple image of the A-configuration data. ]]
|[[Image:SgrA_BonlyCASA5.5.0.jpeg|400px|thumb|left|'''Figure 2b:''' <br />Simple image of the B-configuration data. To get a similar image, in the Viewer task, click on the Wrench icon and in the Basic setting change the data range to [-0.01, 0.115]]]
|[[Image:BonlyW49A.png|300px|thumb|left|'''Figure 2b:''' <br />Simple image of the B-configuration data. ]]
|[[Image:SgrA_ConlyCASA5.5.0.jpeg|400px|thumb|left|'''Figure 2c:''' <br />Simple image of the C-configuration data. To get a similar image, in the Viewer task, click on the Wrench icon and in the Basic setting change the data range to [-0.1, 1]]]
|[[Image:ConlyW49A.png|300px|thumb|left|'''Figure 2c:''' <br />Simple image of the C-configuration data. ]]
|[[Image:DonlyW49A.png|300px|thumb|left|'''Figure 2c:''' <br />Simple image of the D-configuration data. ]]
|}
|}


The basic parameters of the individual images can be checked through [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.information.imhead.html imhead] for the spatial resolution and determining the rms when checking the statistics of empty areas within the viewer. The central point source, Sgr A*, is variable and we see this reflected in the flux density values from the images taken in the three different configurations, which were separated in observing time by several months (get the peak flux values from within the [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.visualization.viewer.html viewer] or use the [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.information.imstat.html imstat] task):
The basic parameters of the individual images can be checked through [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.information.imhead.html imhead] and the beam sizes are 0.19"x0.19" for A, 0.71"x0.66" for B, 2.20"x2.04" for C and 8.44"x6.36" for D-configuration. This reflects again the factor of three in resolution between the different arrays.
 
A-configuration: synthesized beam  1.40" x 0.40"; rms ~0.8mJy; peak flux density of Sgr A* 0.713 Jy/beam
B-configuration: synthesized beam  4.12" x 1.31"; rms ~0.7mJy; peak flux density of Sgr A* 0.691 Jy/beam
C-configuration: synthesized beam 11.18" x 3.98"; rms ~0.6mJy; peak flux density of Sgr A* 1.314 Jy/beam


== Check and Adjust the Visibility Weights ==
== Check and Adjust the Visibility Weights ==


VLA weights are currently based only on channel width and correlator integration time. In the future, the VLA may use the switched power measurements to derive absolute calibrated weights. At the moment, however, the VLA weights need to be taken as being relative to each other. The relative sensitivity within an observation is measured by the gain, so weights of single, continuous observations are self-consistent. It is important to adjust the weights between ''separate'' observations as they will be on different scales.  
VLA visibility weights are currently based only on channel width and correlator integration time. In the future, the VLA may use the switched power measurements to derive absolute calibrated weights. At the moment, however, the VLA weights need to be taken as being relative to each other. The relative sensitivity within an observation is measured by the gain, so weights of single, continuous observations are self-consistent. It is important to adjust the weights between ''separate'' observations as they will potentially be on different scales.  


Let's have a look at the weights of the different datasets. We will plot the weights as a function of uv-distance for a single spectral window ('''spw='3''''), average over all channels in one spectral window, and will colorize by antenna:
Let's have a look at the weights of the different datasets. We will plot the weights as a function of uv-distance in a single central channel for improved plotting time:


<source lang="python">
<source lang="python">
# In CASA
# In CASA
# A-config:  
# A-config:  
plotms(vis='A-spw11-W49A.ms',spw='0:64',,xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
plotms(vis='A-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
</source>


Line 234: Line 219:
# In CASA
# In CASA
# B-config
# B-config
plotms(vis='VLA-SgrA-Sband-Bconfig-sub.ms',spw='3',averagedata=True,
plotms(vis='B-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
</source>


Line 241: Line 225:
# In CASA
# In CASA
# C-config:
# C-config:
plotms(vis='VLA-SgrA-Sband-Cconfig-sub.ms',spw='3',averagedata=True,
plotms(vis='C-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
 
<source lang="python">
# In CASA
# D-config:
plotms(vis='D-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
</source>


Fig. 4a-c shows that there are some differences. Data from configurations A and B have weights that are reasonably comparable. C-configuration data, however, seems to have consistently lower values.
Fig. 3a-d shows the weights and they are as described above.  


{|
{|
|[[Image:Awt_CASA5.5.0.png|400px|thumb|left|'''Figure 4a:''' <br />A-config original weights.]]
|[[Image:AwtW49A.png|300px|thumb|left|'''Figure 3a:''' <br />A-config original weights.]]
|[[Image:Bwt_CASA5.5.0.png|400px|thumb|left|'''Figure 4b:''' <br />B-config original weights.]]
|[[Image:BwtW49A.png|300px|thumb|left|'''Figure 3b:''' <br />B-config original weights.]]
|[[Image:Cwt_CASA5.5.0.png|400px|thumb|left|'''Figure 4c:''' <br />C-config original weights.]]
|[[Image:CwtW49A.png|300px|thumb|left|'''Figure 3c:''' <br />C-config original weights.]]
|[[Image:DwtW49A.png|300px|thumb|left|'''Figure 3d:''' <br />D-config original weights.]]
|}
|}


Line 264: Line 254:
3) Calculate the weights based on the rms of the cross-polarization products (currently not supported in [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt]).
3) Calculate the weights based on the rms of the cross-polarization products (currently not supported in [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt]).


We recommend to reset the weights when there are strong sources present in the data as they will change the rms of the visibilities and the rms will not be representative of the noise anymore. Without strong sources, [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] should deliver better results. The third option may work both cases, but requires full polarization observations and calibrations. For this guide we will perform the statwt path as an example. But the user should be aware of the different options for optimized imaging.
We recommend to reset the weights when there are strong sources present in the data as they will change the rms of the visibilities and the rms will not be representative of the noise anymore. Without strong sources, [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] should deliver better results. The third option may work for both cases, but requires full polarization observations and calibrations. For this guide we will follow the [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] path as an example. But the user should be aware of the different options for optimized imaging.  
 
 
<!--
=== Option 1: Resetting the weights ===
 
As we will overwrite the WEIGHT column, we first create copies of our MSs in case we will have to revert to the original data:
 
<pre style="background-color: lightgrey;”>
# In a Terminal
cp -r VLA-SgrA-Sband-Aconfig-sub.ms VLA-SgrA-Sband-Aconfig-sub-initwt.ms
cp -r VLA-SgrA-Sband-Bconfig-sub.ms VLA-SgrA-Sband-Bconfig-sub-initwt.ms
cp -r VLA-SgrA-Sband-Cconfig-sub.ms VLA-SgrA-Sband-Cconfig-sub-initwt.ms
</pre>
 
Now we will reset the weights with [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.calibration.initweights.html initweights]. Parameter ''wtmode='nyq''' is the default and resets the weights based on the channel width and correlator integration time (see above).
 
<source lang="python">
# In CASA
# A-config:
initweights(vis='VLA-SgrA-Sband-Aconfig-sub-initwt.ms',wtmode='nyq')
</source>
 
<source lang="python">
# In CASA
# B-config:
initweights(vis='VLA-SgrA-Sband-Bconfig-sub-initwt.ms',wtmode='nyq')
</source>
 
<source lang="python">
# In CASA
# C-config:
initweights(vis='VLA-SgrA-Sband-Cconfig-sub-initwt.ms',wtmode='nyq')
</source>
 
 
 
CASA will come up with a message that the CORRECTED column is not found and that DATA is being used. This is fine as indeed the MS only contains a DATA column as CORRECTED was [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.split.html split] out after calibration, which then populated the DATA column in the new MS.
 
Let's have a look at the weight values again to see if [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.calibration.initweights.html initweights] has reset the weights properly:
 
First, let's plot every visibility (Figure 5a):
<source lang="python">
# In CASA
# A-config:
plotms(vis='VLA-SgrA-Sband-Aconfig-sub-initwt.ms',spw='3',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
 
And now, let's average across channels
<source lang="python">
# In CASA
# A-config:
plotms(vis='VLA-SgrA-Sband-Aconfig-sub-initwt.ms',spw='3',averagedata=True,
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
 
<source lang="python">
# In CASA
# B-config
plotms(vis='VLA-SgrA-Sband-Bconfig-sub-initwt.ms',spw='3',averagedata=True,
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
 
<source lang="python">
# In CASA
# C-config:
plotms(vis='VLA-SgrA-Sband-Cconfig-sub-initwt.ms',spw='3',averagedata=True,
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
{|
|[[Image:VLA_comb_initwtCASA5.5.0.png|400px|thumb|left|'''Figure 5a:''' <br />Weights after they were reset.]]
|}
 
{|
|[[Image:initwt_Aavg_CASA5.5.0.png|400px|thumb|left|'''Figure 5b:''' <br />Channel averaged weights for the A configuration data after they were reset.]]
|[[Image:initwt_Bavg_CASA5.5.0.png|400px|thumb|left|'''Figure 5c:''' <br />Channel averaged weights for the B configuration data after they were reset.]]
|[[Image:initwt_Cavg_CASA5.5.0.png|400px|thumb|left|'''Figure 5d:''' <br />Channel averaged weights for the C configuration data after they were reset.]]
|}
 
The weights are plotted in Fig. 5a for one configuration and per channel. They are identical for all data sets, as the data were taken in the same way for all configurations with 3s correlator integration time and 2MHz channel width. According to the equation above, this amounts to a weight of 1.2e7 for all visibilities. Figures 5b,c, and d show the weights for channel-averaged data. Note that the correct weights are the sums across all 64 channels, which  adds up to ~7e8. Flagged channels are reducing the weights.


-->


=== Calculating the weights based on the rms ===
=== Calculating the weights based on the rms ===


!!! the pipeline has already run statwt, maybe use a dataset tright hat was not pipelined !!!


[https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] will bring all the weights of all observations on the same scale. The task recalculates the visibility weights based on the inverse of their rms. Task [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] is part of the [https://go.nrao.edu/vla-pipe VLA pipeline], which was used to calibrate the original data. This explains the similarity of the A and B configuration weights in Fig. 4a and b. We will nevertheless run [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] once more on all files in order to ensure proper compatibility of the data (older versions of CASA may have been used for the pipeline, and CASA underwent major changes in its [https://casadocs.readthedocs.io/en/stable/notebooks/data_weights.html definition of data weights]).
[https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] will bring all the weights of all observations on the same scale. The task recalculates the visibility weights based on the inverse of their rms. Task [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] is part of the [https://go.nrao.edu/vla-pipe VLA pipeline], so the pipelined data may already have recalculated weights and this step can be skipped. It does not hurt though, to re-run [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt].
For more information on weights, see [https://casadocs.readthedocs.io/en/stable/notebooks/data_weights.html definition of data weights].


Task [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] will be executed on each MS. The default setting calculates the weight based on the rms of each scan and spectral window. This setting works quite well for continuum observations. We would like to note though that for spectral line data the ''fitspw'' parameter should be set to exclude the line from the calculations. Otherwise, strong lines will be down-weighted.  
Task [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] will be executed on each MS. The default setting calculates the weight based on the rms of each scan and spectral window. This setting works quite well for continuum observations. We would like to note though that for spectral line data the ''fitspw'' parameter should be set to exclude the line from the calculations. Otherwise, strong lines will be down-weighted.  


As [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] will overwrite the WEIGHT column, we once more create copies of our MSs in case we will have to revert to the original data:
Now, we execute [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt]. Since the DATA column is our calibrated data (see above; in a general case it would be the CORRECTED_DATA column), we calculate the rms based on the values in that column:
 
<pre style="background-color: lightgrey;”>
# In a Terminal
cp -r VLA-SgrA-Sband-Aconfig-sub.ms VLA-SgrA-Sband-Aconfig-sub-statwt.ms
cp -r VLA-SgrA-Sband-Bconfig-sub.ms VLA-SgrA-Sband-Bconfig-sub-statwt.ms
cp -r VLA-SgrA-Sband-Cconfig-sub.ms VLA-SgrA-Sband-Cconfig-sub-statwt.ms
</pre>
Now, we execute [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] on the new datasets:


<source lang="python">
<source lang="python">
# In CASA
# In CASA
# A-config:  
# A-config:  
statwt(vis='A-only-spw11-W47A-statwt.ms',datacolumn='data')
statwt(vis='A-W49A.ms',datacolumn='data')
</source>


<source lang="python">
# In CASA
# B-config
# B-config
statwt(vis='VLA-SgrA-Sband-Bconfig-sub-statwt.ms')
statwt(vis='B-W49A.ms',datacolumn='data')
</source>


<source lang="python">
# In CASA
# C-config:
# C-config:
statwt(vis='VLA-SgrA-Sband-Cconfig-sub-statwt.ms')
statwt(vis='C-W49A.ms',datacolumn='data')
 
# D-config:
statwt(vis='D-W49A.ms',datacolumn='data')
</source>
</source>


Let's have a look at the weight values again to see if [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] has adjusted the weights properly:
Let's have a look at the weight values again to see if [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] has adjusted the weights properly:
Line 390: Line 287:
# In CASA
# In CASA
# A-config:  
# A-config:  
plotms(vis='VLA-SgrA-Sband-Aconfig-sub-statwt.ms',spw='3',averagedata=True,
plotms(vis='A-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>


<source lang="python">
# In CASA
# B-config
# B-config
plotms(vis='VLA-SgrA-Sband-Bconfig-sub-statwt.ms',spw='3',averagedata=True,
plotms(vis='B-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>


<source lang="python">
# In CASA
# C-config:
# C-config:
plotms(vis='VLA-SgrA-Sband-Cconfig-sub-statwt.ms',spw='3',averagedata=True,
plotms(vis='C-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
      avgchannel='64',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
 
# D-config:
plotms(vis='D-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
</source>
</source>


In Fig. 6a-c we plot the new, recalculated weights for the three configurations. The absolute scaling has indeed changed, likely due to a different weight definition that was used in earlier versions of CASA when the data were calibrated. The relative weights between A and B configurations still appear to be similar to the original, relative numbers. The C-configuration weights, however, appear to be slightly lower relative to A and B, likely due to more flux in the MS.  
 
In Fig. 4a-d we plot the new, recalculated weights for the three configurations. The absolute scaling has indeed changed. and is now in units of 1/Jy^2.


{|
{|
|[[Image:A_statwt_CASA5.5.0.png|400px|thumb|left|'''Figure 6a:''' <br />A-config recalculated weights.]]
|[[Image:Astatwt.png|300px|thumb|left|'''Figure 4a:''' <br />A-config recalculated weights.]]
|[[Image:B_statwt_CASA5.5.0.png|400px|thumb|left|'''Figure 6b:''' <br />B-config recalculated weights.]]
|[[Image:Bstatwt.png|300px|thumb|left|'''Figure 4b:''' <br />B-config recalculated weights.]]
|[[Image:C_statwt_CASA5.5.0.png|400px|thumb|left|'''Figure 6c:''' <br />C-config recalculated weights.]]
|[[Image:Cstatwt.png|300px|thumb|left|'''Figure 4c:''' <br />C-config recalculated weights.]]
|[[Image:Dstatwt.png|300px|thumb|left|'''Figure 4d:''' <br />D-config recalculated weights.]]
|}
|}


== Combining and Imaging All Data ==
== Combining and Imaging All Data ==


We will now create a combined image of all three re-weighted datasets.  
We will now create a combined image of all four re-weighted datasets.  


First, let's check the new uv-coverage. We concatenate the data with [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.concat.html concat] (alternatively, one can use [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.virtualconcat.html virtualconcat], a task that can also concatenate multi-MSs):
First, let's check the new uv-coverage. We concatenate the data with [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.concat.html concat]:


<source lang="python">
<source lang="python">
# In CASA
# In CASA
concat(vis=['VLA-SgrA-Sband-Aconfig-sub-statwt.ms','VLA-SgrA-Sband-Bconfig-sub-statwt.ms','VLA-SgrA-Sband-Cconfig-sub-statwt.ms'],concatvis='VLA-SgrA-Sband-statwt-combined.ms')
concat(vis=['A-W49A.ms','B-W49A.ms','C-W49A.ms','D-W49A.ms'],concatvis='ABCD-W49A.ms')
</source>
</source>


Now let's plot the uv-coverage of the combined MSs, e.g.:  
Now let's plot the uv-coverage of the combined MSs. Since the spws have been renumbered, we plot the central channel of each sub-configuration with the spw='*:32' keyword:  


<source lang="python">
<source lang="python">
# In CASA
# In CASA
plotms(vis='combined.ms',xaxis='Uwave',yaxis='Vwave',spw='*:64')
plotms(vis='ABCD-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='*:32')
</source>
</source>


Fig. 7 shows the combined uv-coverage, which extends to A-configuration baselines but with a much higher density at the intermediate and shorter baselines contributed from B and C configurations.  
Fig. 5 shows the combined uv-coverage, which extends to A-configuration baselines but with a much higher density at the intermediate and short baselines contributed from B, C, and D configurations.  


{|
{|
|[[Image:Combined_UV_CoverCASA5.7.png|500px|thumb|left|'''Figure 7:''' <br />Combined uv-coverage.]]
|[[Image:ABCDW49Auvcover.png|500px|thumb|left|'''Figure 5:''' <br />Combined uv-coverage.]]
|}
|}




Although [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.concat.html concat]  merges all three MSs into a single one, it is actually not a required step before imaging. Task [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] will take care of the combination when all datasets are specified as a list. By default, [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] will image the data in the CORRECTED columns, i.e. it will use the portion of the MS which exhibits the data with the subtracted Sgr A* point source (if CORRECTED is not present, it will image the visibilities stored in the DATA column). Tclean will also perform the spectral regridding of all datasets on the fly, in particular in ''mode="velocity"'' or ''mode="frequency"''. There's no need to run [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.cvel.html cvel]/[https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.cvel2.html cvel2] (or [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.mstransform.html mstransform]) to Doppler correct the MSs beforehand.  
Although [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.concat.html concat]  merges all four MSs into a single one, it is actually not a required step before imaging. Task [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] will take care of the combination when all datasets are specified as a list. Tclean will also perform the spectral regridding of all datasets on the fly, in particular in ''mode="velocity"'' or ''mode="frequency"''. There's no need to run [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.cvel.html cvel]/[https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.cvel2.html cvel2] (or [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.mstransform.html mstransform]) to Doppler correct the MSs beforehand.  


We will now create a combined image in [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean]. The ''threshold'' parameter was derived by a previous run of [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] on the combined MS for which we determined the rough rms noise. For our threshold, we will use the rms noise multiplied by a factor of ~2.5.  
We will now create a combined image in [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean]. The ''threshold'' parameter was derived by a previous run of [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] on the combined MS for which we determined the rough rms noise. For our threshold, we will use the rms noise multiplied by a factor of ~2.5.  
Line 450: Line 343:
<source lang="python">
<source lang="python">
# In CASA
# In CASA
tclean(vis=['VLA-SgrA-Sband-statwt-combined.ms'],  
tclean(vis=['ABCD-W49A.ms'], imagename='W49A_combinedABCD',specmode='mfs',cell='0.05arcsec',imsize=[1280,1280],
      imagename='GC-statwt-all',field='J1745-2900',specmode='mfs',cell='0.1arcsec',imsize=[1280,1280],niter=3000,
niter=10000, weighting='briggs',robust=0, phasecenter='J2000 19:10:14  +09.06.13.7',threshold='2mJy')
      threshold='5mJy',weighting='briggs',robust=0)
</source>
</source>
<!--
The resulting images look somewhat different when plotted on the same scales (Fig. 8a-b). To start, the beams are 1.74"x0.61" for the one with initialized data weights and 1.58"x0.50" for the one with [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.statwt.html statwt] computed weights. Those values are similar to the resolution of A-configuration only, but we do note that the one with the larger beam also shows the extended emission more prominently. The rms is ~2mJy and thus better than A-only for the initialized weights image (about a factor of 2 less for the statwt image) and there are clearly many more extended spatial scales in both images.




{|
|[[Image:CombImg_InitWts_CASA5.5.0.jpeg|400px|thumb|left|'''Figure 8a:''' <br />Combined image with initialized weights. To get a similar image, in the Viewer task, click on the Wrench icon and in the Basic setting change the data range to [-0.0149, 0.079]]]
-->


{|
{|
|[[Image:CombImg_StatWt_CASA5.7.png|400px|thumb|left|'''Figure 8:''' <br />Combined image with statwt. To get a similar image, in the Viewer task, click on the Wrench icon and in the Basic setting change the data range to [0, 0.05]]]
|[[Image:ABCDimage.png|400px|thumb|left|'''Figure 6:''' <br />Combined image. ]]
|}
|}


The combined beam is now 0.26"x0.24".
The image (Fig. 6) can still be improved upon. For simplicity, we did not use any interactive cleaning in the above, but we highly recommend it for producing the final images. Improvements can also be obtained by adjusting the image weights via the Briggs robust parameter, adding a taper, or weighting the different datasets against each other using ''visweightscale'' in [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.concat.html concat]. Wide-band imaging and multi-scale imaging will also lead to better results. We refer to the [http://casaguides.nrao.edu/index.php/VLA_CASA_Imaging VLA CASA Imaging Guide] for more details and examples.


== Tips for Selfcal ==
If the source has a bright nucleus or, more generally, a bright unresolved emission, start with the A array data, selfcal, then add B array, selfcal again, and so on. This procedure starts with a high model flux that is increased further. If the source is mostly diffuse, then there is not much signal in the A array data, so start with the D array, selfcal, then add C array, selfcal, and so on. Each selfcal step should be phase-only first with maybe two or more iterations. At the end of each selfcal step, a phase+amplitude selfcal can be attempted, before merging in the next array configuration data. After each merge the selfcal steps can be repeated. General selfcal procedures are outlined in the [https://casaguides.nrao.edu/index.php?title=Karl_G._Jansky_VLA_Tutorials#Self-calibration_of_VLA_Data Self-Calibration topical guide].


The image can still be improved upon. For simplicity, we did not use any interactive cleaning in the above, but we highly recommend it for producing the final images. Improvements can also be obtained by adjusting the image weights via the Briggs robust parameter, adding a taper, or weighting the different datasets against each other using ''visweightscale'' in [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.concat.html concat] . Wide-band imaging and multi-scale imaging will also lead to better results. We refer to the [http://casaguides.nrao.edu/index.php/VLA_CASA_Imaging VLA CASA Imaging Guide] for more details and examples.
== Inserting an artificial Point Source for Sgr A* ==
Finally, we will add in a point source with a canonical flux density of 1 Jy to bring back Sgr A*. We again create a component list and use [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.ft.html ft] to attach the source model. Using [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.uvsub.html uvsub] with ''reverse=True'' will add instead of subtract the MODEL to DATA/CORRECTED. This step can be skipped when Sgr A* is not required. When the data are going to be self-calibrated, we actually recommend to not introduce an artificial source during the calibration steps as it has no phase errors imprinted. For this example, we now re-introduce Sgr A*. Once more, we start by copying the combined datasets:
<pre style="background-color: lightgrey;”>
# In a Terminal
cp -r VLA-SgrA-Sband-statwt-combined.ms VLA-SgrA-Sband-statwt-combined-addPNT.ms
</pre>
Now we create a component list with a 1 Jy point source at the previously derived position of Sgr A*.
<source lang="python">
# In CASA
cl.addcomponent(flux=1, fluxunit='Jy',shape='point', dir='J2000 17:45:40.039 -29.00.28.05')
cl.rename('component-SgrA.cl')
cl.close()
</source>
Finally, we insert it in the model column with [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.ft.html ft] and add it to the data with [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.manipulation.uvsub.html uvsub] to both MSs, the one with initialized weights and the one with recomputed weights:
<source lang="python">
# In CASA
ft(vis='VLA-SgrA-Sband-statwt-combined-addPNT.ms', complist='component-SgrA.cl', usescratch=True)
#
uvsub(vis='VLA-SgrA-Sband-statwt-combined-addPNT.ms',reverse=True)
</source>
Now it is time to image both combined MSs once more:
<source lang="python">
# In CASA
tclean(vis=['VLA-SgrA-Sband-statwt-combined-addPNT.ms'],
      imagename='GC-statwt-all-addPNT',field='J1745-2900',specmode='mfs',cell='0.1arcsec',imsize=[1280,1280],niter=5000,
      threshold='5mJy',weighting='briggs',robust=0)
</source>
{|
|[[Image:CombImg_StatWt_PntSrc_CASA5.7.png|400px|thumb|left|'''Figure 9:''' <br />Combined image with statwt and point source. To get a similar image, in the Viewer task, click on the Wrench icon and in the Basic setting change the data range to [0, 0.05]]]
|}
In Fig. 9 we show the resulting images on the same scales as in Fig. 8a-b. As expected the  main difference is the added point source but some differences due to the [https://casadocs.readthedocs.io/en/v6.2.0/api/tt/casatasks.imaging.tclean.html tclean] algorithm are also visible. Again, one can improve the images as described above.
== Tips for Selfcal ==
If the source has a bright nucleus or, more generally, a bright unresolved emission, start with the A array data, selfcal, then add B array, selfcal again, and so on. This procedure starts with a high model flux that is increased further. If the source is mostly diffuse, then there is not much signal in the A array data, so start with the D array, selfcal, then add C array, selfcal, and so on. Each selfcal step should be phase only first with maybe two or more iterations. At the end of each selfcal step, a phase+amplitude selfcal can be attempted, before merging in the next array configuration data. After each merge the selfcal steps can be repeated.


In our case the steps would be done in the images which have Sgr A* removed; otherwise the variability of Sgr A* prevents such procedures. Also, when we replaced Sgr A* by an artificial 1 Jy source, that source will not have phase fluctuations imprinted and cannot be used for selfcal. It can be reintroduced as described above after all selfcal steps are completed.


<!--
<!--
Line 524: Line 366:
Edited: Updated to CASA 5.4.0 version, Angelica Vargas October 2018
Edited: Updated to CASA 5.4.0 version, Angelica Vargas October 2018
Edited: Updated to CASA 5.5.0, Tony Perreault May 2019
Edited: Updated to CASA 5.5.0, Tony Perreault May 2019
Changed into W49A tutorial: Juergen Ott September 2021
-->
-->


{{Checked 6.2.0}}
{{Checked 6.2.0}}

Latest revision as of 23:56, 5 October 2021

This tutorial was created and tested using CASA 6.2.0

Introduction

A perfect image requires measurement of all spatial scales, which is equivalent to filling in the complete uv plane. Unfortunately, this can never be achieved with an aperture synthesis interferometer, although a large number of baselines, long integration times, and multi-frequency-synthesis are all good approaches to increase the uv-coverage. One method to obtain more baselines is to observe in different array configurations and to combine the data afterwards. Deconvolution algorithms are then given good starting conditions to interpolate across the gaps in the uv-plane to achieve an image that combines the surface brightness sensitivity of the compact baselines with the spatial resolution of the extended baselines.

The VLA can be configured into four principal array configurations: A, B, C, and D. The A configuration is the most extended, and D is the most compact configuration. Consequently, A-configuration data exhibit the highest spatial resolution whereas D-configuration delivers the best surface brightness sensitivity and also images the largest scales of the sky brightness distribution.

In this tutorial, we will combine data from all four VLA configurations (A, B, C, and D) that were observed in X-band continuum toward W49A, a massive star forming region in the Milky Way.

Typical Observing Times

When an object is being observed by the VLA in different array configurations, on-source integration times are ideally matched to reach a common surface brightness sensitivity for all scales. Adjacent VLA configurations result in synthesized beams that differ in linear size by approximately a factor of 3. The beam areas therefore change by factors of ~10 and the more extended configuration would ideally need to have 10 times more integration time than the next compact one. This, however, is frequently not very practical and it turns out that integration times that differ by factors of ~3 deliver data that can be satisfactorily combined. This combination matches the sensitivity of overlapping VLA visibilities when the data are convolved to the same scales.

Although overlapping uv-coverages are essential for the best imaging, it is possible to combine non-overlapping data if one understands that some spacings are not present and that the adjustment of the individual datasets is somewhat subjective. Weighting will be primarily achieved during imaging by the Briggs scheme that allows one to adjust imaging weights between the natural (weighting by the number of visibilities that are gridded in each cell) and uniform (weighting by the cells themselves) extremes.

Additionally, each visibility exhibits weights that should only depend on correlator integration time, bandwidth, and system temperature (Tsys). Note that the VLA does not apply Tsys in the online system. Visibility weights between different observations will therefore need to be adjusted, as described below, before they can be combined.

The Data

We will be combining four different datasets, X-band A, B, C, and D configuration data. The data were all calibrated and the science target split out.

The calibrated measurement sets can be downloaded here: 
https://casa.nrao.edu/Data/EVLA/combination/VLA-combination-W49A.tar.gz (3.0G)


As a first step download the file above, then untar:

# In a Terminal
tar -xzvf VLA-combination-W49A.tar.gz

This will unpack four MeasurementSets (MSs), one for each array configuration:

A-W49A.ms
B-W49A.ms
C-W49A.ms
D-W49A.ms

Initial Imaging

We will inspect the data and create separate images to better understand the image parameters such as on-source integration time, resolution, and rms.

Start CASA:

# In a Terminal
casa

As a first step, let's have a look at the 'listobs' output for the different MSs. For example, the A-configuration MS has the following structure:

# In CASA
listobs(vis='A-W49A.ms')
  ##########################################
  ##### Begin Task: listobs            #####
  listobs( vis='A-W49A.ms', selectdata=True, spw='', field='', antenna='', uvrange='', timerange='', correlation='', scan='', intent='', feed='', array='', observation='', verbose=True, listfile='', listunfl=False, cachesize=50.0, overwrite=False )
  ================================================================================
             MeasurementSet Name:  /lustre/aoc/sciops/jott/casa/combination-2021/data/vis-small3/A-W49A.ms      MS Version 2
  ================================================================================
     Observer: Dr. Chris De Pree     Project: uid://evla/pdb/30105074
  Observation: EVLA
  Computing scan and subscan properties...
  Data records: 764478       Total elapsed time = 8973 seconds
     Observed from   24-Jun-2015/07:32:30.0   to   24-Jun-2015/10:02:03.0 (UTC)

     ObservationID = 0         ArrayID = 0
    Date        Timerange (UTC)          Scan  FldId FieldName             nRows     SpwIds   Average Interval(s)    ScanIntent
    24-Jun-2015/07:32:30.0 - 07:42:24.0     4      0 W49A                     69498  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                07:42:27.0 - 07:47:24.0     5      0 W49A                     34749  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                07:49:27.0 - 07:59:21.0     7      0 W49A                     69498  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                07:59:24.0 - 08:04:21.0     8      0 W49A                     34749  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                08:06:24.0 - 08:16:18.0    10      0 W49A                     69498  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                08:16:21.0 - 08:21:18.0    11      0 W49A                     34749  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                08:23:21.0 - 08:33:18.0    13      0 W49A                     69849  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                08:33:21.0 - 08:38:15.0    14      0 W49A                     34398  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                08:40:18.0 - 08:50:15.0    16      0 W49A                     69849  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                08:50:18.0 - 08:55:12.0    17      0 W49A                     34398  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                08:57:15.0 - 09:07:12.0    19      0 W49A                     69849  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                09:07:15.0 - 09:12:09.0    20      0 W49A                     34398  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                09:40:09.0 - 09:50:03.0    25      0 W49A                     69498  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                09:50:06.0 - 09:55:03.0    26      0 W49A                     34749  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
                09:57:06.0 - 10:02:03.0    28      0 W49A                     34749  [0]  [3] [OBSERVE_TARGET#UNSPECIFIED]
             (nRows = Total number of rows per scan)
  Fields: 1
    ID   Code Name                RA               Decl           Epoch   SrcId      nRows
    0    NONE W49A                19:10:12.930999 +09.06.11.88200 J2000   0         764478
  Spectral Windows:  (1 unique spectral windows and 1 unique polarization setups)
    SpwID  Name           #Chans   Frame   Ch0(MHz)  ChanWid(kHz)  TotBW(kHz) CtrFreq(MHz) BBC Num  Corrs
    0      EVLA_X#B0D0#11     64   TOPO    8372.479      2000.000    128000.0   8435.4793       15  RR  LL
  Sources: 1
    ID   Name                SpwId RestFreq(MHz)  SysVel(km/s)
    0    W49A                0     9816.865       8
  Antennas: 27:
    ID   Name  Station   Diam.    Long.         Lat.                Offset from array center (m)                ITRF Geocentric coordinates (m)
                                                                       East         North     Elevation               x               y               z
    0    ea01  N64       25.0 m   -107.37.58.7  +34.02.20.5      -1382.3871    15410.1384      -40.6410 -1599855.687000 -5033332.368600  3567636.613800
    1    ea02  N16       25.0 m   -107.37.10.9  +33.54.48.0       -155.8524     1426.6393       -9.3842 -1601061.957600 -5041175.881400  3556058.033100
    2    ea03  W48       25.0 m   -107.42.44.3  +33.50.52.1      -8707.9476    -5861.7878       15.5283 -1610451.932800 -5042471.123800  3550021.055800
    3    ea04  E40       25.0 m   -107.32.35.4  +33.52.16.9       6908.8199    -3240.7429       39.0197 -1595124.937100 -5045829.476200  3552210.683600
    4    ea05  E72       25.0 m   -107.24.42.3  +33.49.18.0      19041.8648    -8769.1806        4.7639 -1584460.883200 -5052385.614800  3547600.041100
    5    ea06  N40       25.0 m   -107.37.29.5  +33.57.44.4       -633.6056     6878.6057      -20.7877 -1600592.749000 -5038121.341300  3560574.846200
    6    ea07  N72       25.0 m   -107.38.10.5  +34.04.12.2      -1685.6797    18861.8360      -43.4978 -1599557.928700 -5031396.353400  3570494.743400
    7    ea08  E64       25.0 m   -107.27.00.1  +33.50.06.7      15507.6019    -7263.7123       67.2037 -1587600.192200 -5050575.870700  3548885.413900
    8    ea09  W08       25.0 m   -107.37.21.6  +33.53.53.0       -432.1156     -272.1458       -1.4994 -1601614.091200 -5042001.656900  3554652.514300
    9    ea10  E32       25.0 m   -107.34.01.5  +33.52.50.3       4701.6612    -2209.7048       25.2200 -1597053.118400 -5044604.692200  3553059.011100
    10   ea11  W24       25.0 m   -107.38.49.0  +33.53.04.0      -2673.3543    -1784.5861       10.4723 -1604008.747100 -5042135.805100  3553403.716300
    11   ea12  N32       25.0 m   -107.37.22.0  +33.56.33.6       -441.7251     4689.9820      -16.9255 -1600781.044100 -5039347.437000  3558761.543300
    12   ea13  W16       25.0 m   -107.37.57.4  +33.53.33.0      -1348.7131     -890.6107        1.2990 -1602592.853500 -5042054.989100  3554140.713000
    13   ea14  E08       25.0 m   -107.36.48.9  +33.53.55.1        407.8280     -206.0296       -3.2233 -1600801.931400 -5042219.381700  3554706.431200
    14   ea15  E24       25.0 m   -107.35.13.4  +33.53.18.1       2858.1759    -1349.1337       13.7125 -1598663.094300 -5043581.381100  3553767.012000
    15   ea16  W64       25.0 m   -107.46.20.1  +33.48.50.9     -14240.7524    -9606.2900       17.0885 -1616361.575500 -5042770.516600  3546911.419900
    16   ea17  N24       25.0 m   -107.37.16.1  +33.55.37.7       -290.3645     2961.8847      -12.2406 -1600930.072900 -5040316.384900  3557330.407200
    17   ea18  W72       25.0 m   -107.48.24.0  +33.47.41.2     -17419.4641   -11760.2694       14.9442 -1619757.299900 -5042937.656400  3545120.392300
    18   ea19  W40       25.0 m   -107.41.13.5  +33.51.43.1      -6377.9723    -4286.7839        8.2107 -1607962.451800 -5042338.204100  3551324.945500
    19   ea20  N48       25.0 m   -107.37.38.1  +33.59.06.2       -855.2671     9405.9613      -25.9164 -1600374.881000 -5036704.217500  3562667.893900
    20   ea21  E56       25.0 m   -107.29.04.1  +33.50.54.9      12327.6481    -5774.7445       42.6332 -1590380.599000 -5048810.261300  3550108.444300
    21   ea23  E16       25.0 m   -107.36.09.8  +33.53.40.0       1410.0345     -673.4704       -0.7961 -1599926.106100 -5042772.964400  3554319.787600
    22   ea24  W32       25.0 m   -107.39.54.8  +33.52.27.2      -4359.4410    -2923.1315       11.7693 -1605808.637100 
    23   ea25  W56       25.0 m   -107.44.26.7  +33.49.54.6     -11333.1991    -7637.6832       15.3636 -1613255.391400 -5042613.097800  3548545.906000
    24   ea26  E48       25.0 m   -107.30.56.1  +33.51.38.4       9456.6036    -4431.6334       37.9266 -1592894.077600 -5047229.118200  3551221.221000
    25   ea27  N08       25.0 m   -107.37.07.5  +33.54.15.8        -68.9101      433.1984       -5.0732 -1601147.939700 -5041733.820400  3555235.956600
    26   ea28  N56       25.0 m   -107.37.47.9  +34.00.38.4      -1105.2275    12254.3062      -34.2445 -1600128.402500 -5035104.139200  3565024.670400
  Result listobs: True
  Task listobs complete. Start time: 2021-09-10 10:01:51.648534 End time: 2021-09-10 10:01:51.932094
  ##### End Task: listobs              #####
  ##########################################


The data were prepared for this tutorial to contain only one source, W49A, calibrated through the VLA pipeline (although, for the sake of this tutorial, no statwt task has been run, see below). To reduce the size of the files, the MS only contains one spectral window, binned into 64 2MHz channels around 8.4GHz (X-band). We also extracted the calibrated data, discarding the raw data and any model, such that the MS now only contains visibilities in the DATA column. The on-source integration time amounts to about 2.5h. Inspection of the other array configuration files show almost identical setups. Although the integration times between the different array configurations do not follow the 1:3:9:27 ratios that we discussed in the previous section, we can still combine the data without any problem. In the end, having a higher signal to noise ratio on the shorter baselines can only improve the overall combined image.

To better understand the data, let's check the uv-coverage of each of the four datasets. For faster plotting, we only plot channel 32 near the center of each spectral window. All plots are on the same scale:

# In CASA
# A-config: 
plotms(vis='A-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])

# B-config
plotms(vis='B-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])

# C-config:
plotms(vis='C-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])

# D-config:
plotms(vis='D-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='0:32',plotrange=[-1000000,1000000,-1000000,1000000])

The uv-coverage plots are shown in Fig. 1a-d using a common scale. The longest baseline in each array differs by about a factor of 3, as expected, between the VLA A, B, C, and D configurations.


Figure 1a:
UV-coverage of the A-configuration data.
Figure 1b:
UV-coverage of the B-configuration data.
Figure 1c:
UV-coverage of the C-configuration data.
Figure 1d:
UV-coverage of the D-configuration data.

The next step is to determine the image quality, the synthesized beam, and the rms of each image. The images do not have to be perfectly deconvolved as we only would like to see how the combination will improve over the individual arrays.

To keep things simple, we will use common cell sizes of 0.05 arcsec, which samples well the A-configuration beam and oversamples the more compact configurations. We create images of 1280 pixels on each side, and we will tclean 1000 iterations (see the VLA CASA imaging guide for more sophisticated imaging parameter choices). We move the center of the image to the region with the main emission to avoid having to image a very large field of view:

# In CASA
# A-config: 
tclean(vis='A-W49A.ms',imagename='Aonly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
       robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7') 

# B-config:
tclean(vis='B-W49A.ms',imagename='Bonly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
       robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7') 

# C-config:
tclean(vis='C-W49A.ms',imagename='Conly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
       robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7') 

# D-config:
tclean(vis='D-W49A.ms',imagename='Donly',cell='0.05arcsec',imsize=[1280,1280],weighting='briggs',
       robust=0,specmode='mfs',phasecenter='J2000 19:10:14  +09.06.13.7')



The clean images, shown in Fig. 2a-d, give a first impression of the data. Note that when combining the images, we will improve on the uv-coverage and will therefore not only combine high resolution with high surface brightness sensitivity on large scales, but also expect a higher image fidelity, i.e. fewer artifacts due to better deconvolution. In particular, the ripples in the extended configuration data are the typical 'missing short spacing' bowls, that the more compact configurations will fill in to improve the image quality.

Figure 2a:
Simple image of the A-configuration data.
Figure 2b:
Simple image of the B-configuration data.
Figure 2c:
Simple image of the C-configuration data.
Figure 2c:
Simple image of the D-configuration data.

The basic parameters of the individual images can be checked through imhead and the beam sizes are 0.19"x0.19" for A, 0.71"x0.66" for B, 2.20"x2.04" for C and 8.44"x6.36" for D-configuration. This reflects again the factor of three in resolution between the different arrays.

Check and Adjust the Visibility Weights

VLA visibility weights are currently based only on channel width and correlator integration time. In the future, the VLA may use the switched power measurements to derive absolute calibrated weights. At the moment, however, the VLA weights need to be taken as being relative to each other. The relative sensitivity within an observation is measured by the gain, so weights of single, continuous observations are self-consistent. It is important to adjust the weights between separate observations as they will potentially be on different scales.

Let's have a look at the weights of the different datasets. We will plot the weights as a function of uv-distance in a single central channel for improved plotting time:

# In CASA
# A-config: 
plotms(vis='A-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
# In CASA
# B-config
plotms(vis='B-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
# In CASA
# C-config:
plotms(vis='C-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')
# In CASA
# D-config:
plotms(vis='D-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')

Fig. 3a-d shows the weights and they are as described above.

Figure 3a:
A-config original weights.
Figure 3b:
B-config original weights.
Figure 3c:
C-config original weights.
Figure 3d:
D-config original weights.

The next step is to bring the weights on the same relative scale.

There are currently a number of options to do so.


1) Calculate the weights based on the rms of the visibilities themselves, using the statwt task.

2) Reset the weights with initweights to reflect the channel width and correlator integration time ([math]\displaystyle{ WEIGHT=2 \Delta \nu \Delta t }[/math], see the document on Data Weights in CASAdocs).

3) Calculate the weights based on the rms of the cross-polarization products (currently not supported in statwt).

We recommend to reset the weights when there are strong sources present in the data as they will change the rms of the visibilities and the rms will not be representative of the noise anymore. Without strong sources, statwt should deliver better results. The third option may work for both cases, but requires full polarization observations and calibrations. For this guide we will follow the statwt path as an example. But the user should be aware of the different options for optimized imaging.


Calculating the weights based on the rms

statwt will bring all the weights of all observations on the same scale. The task recalculates the visibility weights based on the inverse of their rms. Task statwt is part of the VLA pipeline, so the pipelined data may already have recalculated weights and this step can be skipped. It does not hurt though, to re-run statwt. For more information on weights, see definition of data weights.

Task statwt will be executed on each MS. The default setting calculates the weight based on the rms of each scan and spectral window. This setting works quite well for continuum observations. We would like to note though that for spectral line data the fitspw parameter should be set to exclude the line from the calculations. Otherwise, strong lines will be down-weighted.

Now, we execute statwt. Since the DATA column is our calibrated data (see above; in a general case it would be the CORRECTED_DATA column), we calculate the rms based on the values in that column:

# In CASA
# A-config: 
statwt(vis='A-W49A.ms',datacolumn='data')

# B-config
statwt(vis='B-W49A.ms',datacolumn='data')

# C-config:
statwt(vis='C-W49A.ms',datacolumn='data')

# D-config:
statwt(vis='D-W49A.ms',datacolumn='data')

Let's have a look at the weight values again to see if statwt has adjusted the weights properly:

# In CASA
# A-config: 
plotms(vis='A-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')

# B-config
plotms(vis='B-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')

# C-config:
plotms(vis='C-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')

# D-config:
plotms(vis='D-W49A.ms',spw='0:32',xaxis='uvwave',yaxis='wt',coloraxis='antenna1')


In Fig. 4a-d we plot the new, recalculated weights for the three configurations. The absolute scaling has indeed changed. and is now in units of 1/Jy^2.

Figure 4a:
A-config recalculated weights.
Figure 4b:
B-config recalculated weights.
Figure 4c:
C-config recalculated weights.
Figure 4d:
D-config recalculated weights.

Combining and Imaging All Data

We will now create a combined image of all four re-weighted datasets.

First, let's check the new uv-coverage. We concatenate the data with concat:

# In CASA
concat(vis=['A-W49A.ms','B-W49A.ms','C-W49A.ms','D-W49A.ms'],concatvis='ABCD-W49A.ms')

Now let's plot the uv-coverage of the combined MSs. Since the spws have been renumbered, we plot the central channel of each sub-configuration with the spw='*:32' keyword:

# In CASA
plotms(vis='ABCD-W49A.ms',xaxis='Uwave',yaxis='Vwave',spw='*:32')

Fig. 5 shows the combined uv-coverage, which extends to A-configuration baselines but with a much higher density at the intermediate and short baselines contributed from B, C, and D configurations.

Figure 5:
Combined uv-coverage.


Although concat merges all four MSs into a single one, it is actually not a required step before imaging. Task tclean will take care of the combination when all datasets are specified as a list. Tclean will also perform the spectral regridding of all datasets on the fly, in particular in mode="velocity" or mode="frequency". There's no need to run cvel/cvel2 (or mstransform) to Doppler correct the MSs beforehand.

We will now create a combined image in tclean. The threshold parameter was derived by a previous run of tclean on the combined MS for which we determined the rough rms noise. For our threshold, we will use the rms noise multiplied by a factor of ~2.5.


Image the data with recalculated weights:

# In CASA
tclean(vis=['ABCD-W49A.ms'], imagename='W49A_combinedABCD',specmode='mfs',cell='0.05arcsec',imsize=[1280,1280],
niter=10000, weighting='briggs',robust=0, phasecenter='J2000 19:10:14  +09.06.13.7',threshold='2mJy')


Figure 6:
Combined image.

The combined beam is now 0.26"x0.24". The image (Fig. 6) can still be improved upon. For simplicity, we did not use any interactive cleaning in the above, but we highly recommend it for producing the final images. Improvements can also be obtained by adjusting the image weights via the Briggs robust parameter, adding a taper, or weighting the different datasets against each other using visweightscale in concat. Wide-band imaging and multi-scale imaging will also lead to better results. We refer to the VLA CASA Imaging Guide for more details and examples.

Tips for Selfcal

If the source has a bright nucleus or, more generally, a bright unresolved emission, start with the A array data, selfcal, then add B array, selfcal again, and so on. This procedure starts with a high model flux that is increased further. If the source is mostly diffuse, then there is not much signal in the A array data, so start with the D array, selfcal, then add C array, selfcal, and so on. Each selfcal step should be phase-only first with maybe two or more iterations. At the end of each selfcal step, a phase+amplitude selfcal can be attempted, before merging in the next array configuration data. After each merge the selfcal steps can be repeated. General selfcal procedures are outlined in the Self-Calibration topical guide.



Last checked on CASA Version 6.2.0.