JVLA - Basic and Advanced Imaging in CASA

From CASA Guides
Revision as of 19:43, 26 February 2016 by Jsalcido (talk | contribs)
Jump to navigationJump to search
  • Topical guide, part 2 of 2
  • This CASA guide is designed for CASA 4.5.0


Overview

This CASA guide will cover data calibration and advanced imaging. Such topics include MS (Multi Scale) on regular images, MS-MFS (Multi Scale-Multi Frequency Scale), W-Projection, Wide Field Mode, outlier fields, spectral indices, and interactive mode.

JVLA - Importing and Initial Flagging in CASA:Part 1 of the guide covered the importing of the dataset, time-averaging, and data flagging, including shadow, zero-clipping, tfcrop, rflag, quacking, and online flagging.

We will be utilizing data taken with the Karl G. Jansky, Very Large Array, of a supernova remnant G055.7+3.4.. The data were taken on August 23, 2010, in the first D-configuration for which the new wide-band capabilities of the WIDAR (Wideband Interferometric Digital ARchitecture) correlator were available. The 8-hour-long observation includes all available 1 GHz of bandwidth in L-band, from 1-2 GHz in frequency.

Obtaining the data

We will be utilizing the time-averaged and flagged data from part 1. If you'd like to skip the first part of the tutorial and delve into part 2, you can acquire the measurement set for this tutorial here.

Start and confirm your version of CASA

Start CASA by typing casa on a terminal command line. If you have not used CASA before, some helpful tips are available on the Getting Started in CASA page.

This guide has been written for CASA release 4.5.0. Please confirm your version before proceeding by checking the message in the command line interface window or the CASA logger after startup.

Calibrating data

Now that we are satisfied with the RFI excision, we will move on to the calibration stage.

Setting the flux density scale

Since we will be using 3C147 as the source of the absolute flux scale for this observation, we must first run setjy to set the appropriate model amplitudes for this source.

If the flux calibrator is spatially resolved, it is necessary to include a model image as well. Although 3C147 is not resolved at L-band in D configuration, we include the model image here for completeness.

First, we use the listmodimages parameter to find the model image path:

# In CASA
setjy(vis='SN_G55_10s.ms', listmodels=True)

This lists any images in the current working directory as well as images in CASA's repository. In this second list, we see that there is "3C147_L.im", which is appropriate for our flux calibrator and band, and that it is in the directory "/home/casa/packages/RHEL6/release/casa-release-4.4.0/data/nrao/VLA/CalModels ". We can optionally give the full path of the model image, but setjy should now be able to locate it by name alone:

# In CASA
setjy(vis='SN_G55_10s.ms', field='0542*', scalebychan=True,
      spw='4~5,7~9', model='3C147_L.im')
  • scalebychan=True: scales the model flux density value for each channel.

Note: The task setjy uses the Perley-Butler 2010 standard by default. Periodically, the flux density scale at the VLA is revised, updated, or expanded. The most recent standard is Perley-Butler 2013, and can be used by explicitly setting standard='Perley-Butler 2013' in the task. See help setjy for more details.

Delay and Bandpass calibration

We will follow a similar procedure as the one outlined in part 1, when we created the preliminary bandpass calibration table SN_G55_10s.initPh. This time, we will use the actual designated bandpass calibration source 0542+498=3C147. Although the phase calibration source has the advantage of having been observed throughout the run, it has an unknown spectrum which could introduce amplitude slopes to each spectral window. We will also calibrate the residual antenna-based delays (for further information on this topic, please see this tutorial: [[1]].)

As before, we first generate a phase-only gain calibration table that will be used to help smooth-out the phases before running bandpass itself:

# In CASA
gaincal(vis='SN_G55_10s.ms', field = '5', 
        caltable='SN_G55_10s.initPh.2',
        spw='5;7~8:30~33,4:32~35,9:46~49',
        solint='int', refant='ea24',
        minblperant=3, minsnr=3.0, calmode='p',
        gaintable='SN_G55_10s.pos')

Unfortunately, you will notice a lot of messages that read "Insufficient unflagged antennas to proceed with this solve" for SPW 9. This indicates that too much data have been flagged to perform the gaincal operation. This also suggests that the spectral window is too badly affected by RFI to be useful for imaging -- so, we will flag the rest of the SPW before continuing with further analysis:

# In CASA
flagdata(vis='SN_G55_10s.ms', spw='9')

##WE MIGHT NOT NEED THIS##

We can now solve for the residual antenna-based delays that can be seen in plots of the phase vs. frequency for the calibrator sources in plotms. This uses the 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 use our bright bandpass calibrator, 3C147, to calibrate the delays:

# In CASA
gaincal(vis='SN_G55_10s.ms', field='5', 
        caltable='SN_G55_10s.K0',
        spw='4~5,7~9:4~59', solint='inf', refant='ea24', 
        gaintype='K', combine='scan', minsnr=3, 
        gaintable=['SN_G55_10s.pos','SN_G55_10s.initPh.2'])

We pre-apply our initial phase table, and produce a new K-type caltable for input to bandpass calibration. We can plot the delays, in nanoseconds, as a function of antenna index (you will get one for each sub-band and polarization):

# In CASA
plotcal(caltable='SN_G55_10s.K0', xaxis='antenna', yaxis='delay')

The delays range from around -3 to 5 nanoseconds, which is good. Anything over 10ns would be cause for concern.

Now let's solve for the bandpass using the previous tables:

# In CASA
bandpass(vis='SN_G55_10s.ms', caltable='SN_G55_10s.bPass',
         field='5', solint='inf', spw='4~5,7~9',
         combine='scan', refant='ea24', minblperant=3, minsnr=10.0,
         gaintable=['SN_G55_10s.pos','SN_G55_10s.initPh.2','SN_G55_10s.K0'],
         interp=['', 'nearest', 'nearest'], solnorm=False)
  • solint='inf', combine='scan': again, the solution interval of 'inf' will automatically break-up the data by scans; this requests that the solution intervals be combined over scans, so that we will get one solution per antenna. Note that you must set solnorm=False here or later on you will find some offsets between spws due to the way in which amplitude scaling adjusts weights internally during solving.
Bandpass Gain Amplitudes
Bandpass Gain Phases

Note that since we have flagged-out the vast majority of the RFI-affected data, there are many fewer failed solutions. Again, we can plot the calculated bandpasses to check that they look reasonable:

# In CASA
plotcal(caltable='SN_G55_10s.bPass', xaxis='freq', yaxis='amp',
        iteration='antenna', subplot=331)
#
plotcal(caltable='SN_G55_10s.bPass', xaxis='freq', yaxis='phase',
        iteration='antenna', subplot=331)

Don't let the apparently odd-looking phases for ea24 fool you -- check the scale! Remember, this is our reference antenna.

Gain calibration

Next, we will calculate the per-antenna gain solutions. We will now use the intent option, where we can request phSince this is low-frequency data, we do not expect substantial variations over short timescales, so we calculate one solution per scan (using "solint='inf'"):

# In CASA
gaincal(vis='SN_G55_10s.ms', caltable='SN_G55_10s.phaseAmp',
        intent='*PHASE*,*AMPLI*', spw='4~5,7~9', solint='inf', refant='ea24', minblperant=3,
        minsnr=10.0, gaintable=['SN_G55_10s.pos','SN_G55_10s.K0','SN_G55_10s.bPass'])
  • solint='inf': we request one solution per scan.

Plot these solutions as a function of amplitude and phase versus time for the phase calibrator (field 3), iterating over each antenna:

# In CASA
plotcal(caltable='SN_G55_10s.phaseAmp', xaxis='time', yaxis='amp',
        field = '3', iteration='antenna')

plotcal(caltable='SN_G55_10s.phaseAmp', xaxis='time', yaxis='phase',
        field = '3', iteration='antenna')

Flux scaling the gain solutions

Now that we have a complete set of gain solutions, we must scale the phase calibrator's absolute flux correctly, using 3C147 as our reference source. To do this, we run fluxscale on the gain table we just created, which will write a new, flux-corrected gain table:

# In CASA
myFlux = fluxscale(vis='SN_G55_10s.ms', caltable='SN_G55_10s.phaseAmp',
         fluxtable='SN_G55_10s.phaseAmp.fScale', reference='5', incremental=False)

Note that the myFlux Python dictionary will contain information about the scaled fluxes and fitted spectrum. The logger will display information about the flux density it has deduced for J1331+3030, J1407+2827, J1925+2106, and J0319+4130:

2016-02-25 21:02:13 INFO fluxscale	 Found reference field(s): 0542+498=3C147
2016-02-25 21:02:13 INFO fluxscale	 Found transfer field(s):  J1331+3030 J1407+2827 J1925+2106 J0319+4130
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=0 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=1 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=2 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=3 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=4 (freq=1.319e+09 Hz) is: 15.8651  +/- 0.0974584 (SNR = 162.788, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=5 (freq=1.447e+09 Hz) is: 15.0859  +/- 0.0814688 (SNR = 185.174, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=6 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=7 (freq=1.711e+09 Hz) is: 13.9114  +/- 0.0761242 (SNR = 182.746, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=8 (freq=1.839e+09 Hz) is: 13.4189  +/- 0.0794607 (SNR = 168.874, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1331+3030 in SpW=9 (freq=1.967e+09 Hz) is: 12.765   +/- 0.0803002 (SNR = 158.966, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=0 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=1 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=2 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=3 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=4 (freq=1.319e+09 Hz) is: 0.808907 +/- 0.0222952 (SNR = 36.2817, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=5 (freq=1.447e+09 Hz) is: 0.934951 +/- 0.0209118 (SNR = 44.7093, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=6 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=7 (freq=1.711e+09 Hz) is: 1.19862  +/- 0.0224937 (SNR = 53.2869, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=8 (freq=1.839e+09 Hz) is: 1.29572  +/- 0.024545 (SNR = 52.7894, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1407+2827 in SpW=9 (freq=1.967e+09 Hz) is: 1.40525  +/- 0.0268141 (SNR = 52.4072, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=0 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=1 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=2 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=3 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=4 (freq=1.319e+09 Hz) is: 1.48551 +/- 0.0281482 (SNR = 52.7747, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=5 (freq=1.447e+09 Hz) is: 1.56228 +/- 0.0252192 (SNR = 61.948, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=6 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=7 (freq=1.711e+09 Hz) is: 1.71537 +/- 0.0249252 (SNR = 68.8206, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=8 (freq=1.839e+09 Hz) is: 1.76233 +/- 0.0265346 (SNR = 66.4163, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J1925+2106 in SpW=9 (freq=1.967e+09 Hz) is: 1.80483 +/- 0.0277931 (SNR = 64.9382, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=0 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=1 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=2 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=3 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=4 (freq=1.319e+09 Hz) is: 19.868  +/- 0.0317685 (SNR = 625.4, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=5 (freq=1.447e+09 Hz) is: 19.4127 +/- 0.0301887 (SNR = 643.047, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=6 is:  INSUFFICIENT DATA 
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=7 (freq=1.711e+09 Hz) is: 18.7373 +/- 0.0265107 (SNR = 706.783, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=8 (freq=1.839e+09 Hz) is: 18.1355 +/- 0.0252894 (SNR = 717.117, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Flux density for J0319+4130 in SpW=9 (freq=1.967e+09 Hz) is: 17.554  +/- 0.0232537 (SNR = 754.894, N = 40)
2016-02-25 21:02:14 INFO fluxscale	 Fitted spectrum for J1331+3030 with fitorder=1: Flux density = 14.1688 +/- 0.0412941 (freq=1.63859 GHz) spidx=-0.523867 +/- 0.020257
2016-02-25 21:02:14 INFO fluxscale	 Fitted spectrum for J1407+2827 with fitorder=1: Flux density = 1.10734 +/- 0.00843186 (freq=1.63859 GHz) spidx=1.37278   +/- 0.0546467
2016-02-25 21:02:14 INFO fluxscale	 Fitted spectrum for J1925+2106 with fitorder=1: Flux density = 1.66257 +/- 0.00626826 (freq=1.63859 GHz) spidx=0.494167  +/- 0.0266929
2016-02-25 21:02:14 INFO fluxscale	 Fitted spectrum for J0319+4130 with fitorder=1: Flux density = 18.7234 +/- 0.0906548 (freq=1.63859 GHz) spidx=-0.300084 +/- 0.0329395

The flux density listed in the VLA Calibrator Manual for J1925+2106 (known then as J1925+211 for J2000 epoch) is around the same magnitude at L-Band:

1925+211   J2000  A 19h25m59.605370s  21d06'26.162180"  Aug01         
1923+210   B1950  A 19h23m49.792400s  21d00'23.305000"
-----------------------------------------------------
BAND        A B C D    FLUX(Jy)    UVMIN(kL)  UVMAX(kL)
=====================================================
 20cm    L  P S S S       1.30                       visplot
  6cm    C  P P S S       1.5
3.7cm    X  P P P P       1.00                       visplot
  2cm    U  P P P P       1.8
1.3cm    K  S S S S       0.90                       visplot
0.7cm    Q  S S S S       1.0 

We can also check the other calibrators and compare our results to those in the manual. We can see that our flux density values are very close to those found online, so we should be satisfied that our calibration up to this point is reasonable.

Applying calibration

Finally, we must apply the calibration to our data. To do this, we run applycal in two stages: the first is to self-calibrate our calibration sources; the second, to apply calibration to the supernova remnant. These must be done separately, since we want to use "nearest" interpolation for the self-calibration and "linear" (this is the default, so we can omit requesting the interpolation) for the application to the science target:

# In CASA
applycal(vis='SN_G55_10s.ms', spw='4~5,7~9', intent='*PHASE*,*AMPLI*',
         gaintable=['SN_G55_10s.pos','SN_G55_10s.K0','SN_G55_10s.bPass', \
                    'SN_G55_10s.phaseAmp.fScale'], \
         calwt=False, interp=['','nearest','nearest','nearest'])

applycal(vis='SN_G55_10s.ms', spw='4~5,7~9', intent='*TARGET*',
         gaintable=['SN_G55_10s.pos','SN_G55_10s.K0','SN_G55_10s.bPass', \
                    'SN_G55_10s.phaseAmp.fScale'], calwt=False)

Plotting calibrated data

J1925+2106 Corrected Real vs. Imaginary
J1925+2106 Corrected Amplitude vs. Baseline
3C147 Corrected Real vs. Imaginary
3C147 Corrected Amplitude vs. Baseline

To check that everything has truly proceeded as well as we would like, this is a good time to look at the calibrated data in plotms. A very useful way to check the quality of the calibration, is to plot the corrected real vs. imaginary portions of the visibilities of our calibrators.

For a point source at the phase center, the plot should look like scatter around zero for the imaginary axis (zero phase), and scatter around the flux density value (amplitude) of the source, in the real axis. The corrected amplitude vs. baseline, which should be a flat line of points for a point source, will reveal any lingering antenna-based problems. For a resolved source, it may be more instructive to plot corrected amplitude vs. UV-distance.

# In CASA
plotms(vis='SN_G55_10s.ms', field='3', xaxis='imag', yaxis='real',
       xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',
       avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',
       spw='4~5,7~9', plotrange=[-1.5,1.5,0,3])
#
plotms(vis='SN_G55_10s.ms', field='3', xaxis='baseline', yaxis='amp',
       xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',
       avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',
       spw='4~5,7~9', plotrange=[0,450,0.5,2.5])
#
plotms(vis='SN_G55_10s.ms', field='5', xaxis='imag', yaxis='real',
       xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',
       avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',
       spw='4~5,7~9', plotrange=[-5,5,18,28])
#
plotms(vis='SN_G55_10s.ms', field='5', xaxis='baseline', yaxis='amp',
       xdatacolumn='corrected', ydatacolumn='corrected', coloraxis='antenna1',
       avgchannel='10', avgtime='20', correlation='RR,LL', iteraxis='spw',
       spw='4~5,7~9', plotrange=[0,450,18,28])

Splitting out data for G55.7+3.4

Now that we are satisfied with the calibration, we will create a new MS which contains only the corrected data for G55.7+3.4 using the task split2. The split task is used to make a new data set that is a subset of an existing data set. The Split2 task provides the functionality of split, but is based on the mstransform framework underneath, which is more versatile. For more on split2, see the CASA Cookbook, section 4.7.4.1. Starting with CASA version 4.6, the split2 task will be renamed split, and replace the current split task.

Splitting out just the target we want to image will substantially reduce the size of the MS, and will speed up the imaging process. We can also drop the polarization products since they have not been calibrated and will not be used for imaging.

# In CASA
split2(vis='SN_G55_10s.ms', field='4', keepflags=False,
      outputvis='SN_G55_10s.calib.ms', datacolumn='corrected',
      spw='4~5,7~9', correlation = 'RR,LL')

Imaging

The size of the primary beam is 45 divided by the observed frequency in GHz, or around 30 arcmin. Since the observation was taken in D-configuration, we can check the Observational Status Summary's section on VLA resolution to find that the synthesized beam will be around 44 arcsec. We want to oversample the synthesized beam by a factor of around five, so we will use a cell size of 8 arcsec.

Since this field contains bright point sources significantly outside the primary beam, we will create images that are 170 arcminutes on a side, or almost 6 x the size of the primary beam. This is ideal for showcasing both the problems inherent in such wide-band, wide-field imaging, as well as some of the solutions currently available in CASA to deal with these issues.

First, it's worth considering why we are even interested in sources which are far outside the primary beam. This is mainly due to the fact that the EVLA, with its wide bandwidth capabilities, is quite sensitive even far from phase center -- for example, at our observing frequencies in L-band, the primary beam gain is as much as 10% around 1 degree away. That means that any imaging errors for these far-away sources will have a significant impact on the image rms at phase center. The error due to a source at distance R can be parametrized as:

[math]\displaystyle{ \Delta(S) = S(R) \times PB(R) \times PSF(R) }[/math]

So, for R = 1 degree, source flux S(R) = 1 Jy, [math]\displaystyle{ \Delta(S) }[/math] = 1 mJy − 100 [math]\displaystyle{ {\mu} }[/math]Jy. Clearly, this will be a source of significant error.

Multi-Scale Clean

G55.7+3.4 Multi-Scale Clean
G55.7+3.4 Multi-Scale Clean, Zoomed-In

Since G55.7+3.4 is an extended source with many spatial scales, the most basic (yet still reasonable) imaging procedure is to use clean with multiple scales. MS-CLEAN is an extension of the classical CLEAN algorithm for handling extended sources. It works by assuming the sky is composed of emission at different spatial scales and works on them simultaneously.

For this tutorial, we will also be itilizing tclean, which is a refactored version of clean, with a better interface, and provides more possible combinations of algorithms. It also allows for process computing parallelization of the imaging and deconvolution, thereby maximizing processing power and minimizing the time needed to finish. Eventually, tclean will replace the current clean task.

As is suggested, we will use a set of scales (which are expressed in units of the requested pixel, or cell, size) which are representative of the scales that are present in the data, including a zero-scale for point sources.

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.

# In CASA
tclean(vis='SN_G55_10s.calib.ms', imagename='SN_G55_10s.tclean.MultiScale', imsize=1280, 
      cell='8arcsec', deconvolver='multiscale', scales=[0,6,10,30,60], 
      interactive=False, niter=1000,  weighting='briggs',
      stokes='I', threshold='0.1mJy')

clean(vis='SN_G55_10s.calib.ms', imagename='SN_G55_10s.MultiScale',
      imsize=1280, cell='8arcsec', multiscale=[0,6,10,30,60],
      interactive=False, niter=1000,  weighting='briggs',
      stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')

viewer('SN_G55_10s.MultiScale.image')
  • imagename='SN_G55_10s.MultiScale': the root filename used for the various clean outputs. These include the final image (<imagename>.image), the relative sky sensitivity over the field (<imagename>.flux), the point-spread function (also known as the dirty beam; <imagename>.psf), the clean components (<imagename>.model), and the residual image (<imagename>.residual).
  • imsize=1280: the image size in number of pixels. Note that entering a single value results in a square image with sides of this value.
  • cell='8arcsec': the size of one pixel; again, entering a single value will result in a square pixel size.
  • multiscale=[0,6,10,30,60]: a set of scales on which to clean. Since these are in units of the pixel size, our chosen values will be multiplied by the requested cell size. Thus, we are requesting scales of 0 (a point source), 48, 80, 240, and 480 arcseconds. Note that 16 arcminutes (960 arcseconds) roughly corresponds to the size of G55.7+3.4.
  • interactive=False: we will let clean use the entire field for placing model components. Alternatively, you could try using interactive=True, and create regions to constrain where components will be placed. However, this is a very complex field, and creating a region for every bit of diffuse emission as well as each point source can quickly become tedious.
  • niter=1000: this controls the number of iterations clean will do in the minor cycle.
  • weighting='briggs': use Briggs weighting with a robustness parameter of 0 (halfway between uniform and natural weighting).
  • usescratch=F: do not write the model visibilities to the model data column (only needed for self-calibration)
  • imagermode='csclean': use the Cotton-Schwab clean algorithm
Artifacts Around Point Sources
  • stokes='I': since we have not done any polarization calibration, we only create a total-intensity image.
  • threshold='0.1mJy': threshold at which the cleaning process will halt; i.e. no clean components with a flux less than this value will be created. This is meant to avoid cleaning what is actually noise (and creating an image with an artificially low rms). It is advisable to set this equal to the expected rms, which can be estimated using the EVLA exposure calculator. However, in our case, this is a bit difficult to do, since we have lost a hard-to-estimate amount of bandwidth due to flagging, and there is also some residual RFI present. Therefore, we choose 0.1 mJy as a relatively conservative limit.

This is the fastest of the imaging techniques described here, but it's easy to see that there are artifacts in the resulting image. For example, use the viewer to explore the point sources near the edge of the field by zooming in on them. Some have prominent arcs, as well as spots in a six-pointed pattern surrounding them. Note that you may need to play with the brightness/contrast of the image to see more detail. Next we will explore some more advanced imaging techniques to mitigate these artifacts.

Multi-Scale, Wide-Field Clean (W-Projection)

The next clean algorithm we will employ is W-Projection, which is a wide-field imaging technique that takes into account the non-coplanarity of the baselines as a function of distance from the phase center. For wide-field imaging, the sky curvature and non-coplanar baselines results in a non-zero w-term. Applying 2-D imaging to such data will result in artifacts around sources away from the phase center, as we saw in running MS-CLEAN.

More details on imaging and deconvolution can be found here. For more details on W-Projection, as well as the algorithm itself, see "The Noncoplanar Baselines Effect in Radio Interferometry: The W-Projection Algorithm".

# In CASA
clean(vis='SN_G55_10s.calib.ms', imagename='SN_G55_10s.MS.wProj',
      gridmode='widefield', imsize=1280, cell='8arcsec',
      wprojplanes=128, multiscale=[0,6,10,30,60], 
      interactive=False, niter=1000,  weighting='briggs',
      stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')

viewer('SN_G55_10s.MS.wProj.image')
W-Projection Improvements
  • gridmode='widefield': Use the W-Projection algorithm.
  • wprojplanes=128: The number of W-Projection planes to use for deconvolution; 128 is the minimum recommended number.

This will take slightly longer than the previous imaging round; however, the resulting image has noticeably fewer artifacts. In particular, compare the same outlier source in the W-Projected image with the Multi-Scale-only image: note that the swept-back arcs have disappeared. There are still some obvious imaging artifacts remaining, though.

Multi-Scale, Multi-Frequency Synthesis

Another consequence of simultaneously imaging the wide fractional bandwidths available with the EVLA is that the primary beam has substantial frequency-dependent variation over the observing band. If this is not accounted for, it will lead to imaging artifacts and compromise the achievable image rms.

If sources which are being imaged have intrinsically flat spectra, this will not be a problem. However, most astronomical objects are not flat-spectrum sources, and without any estimation of the intrinsic spectral properties, the fact that the primary beam is twice as large at 2 than at 1 GHz will have substantial consequences.

The Multi-Scale Multi-Frequency-Synthesis (MS-MFS) algorithm provides the ability to simultaneously image and fit for the intrinsic source spectrum. The spectrum is approximated using a polynomial in frequency, with the degree of the polynomial as a user-controlled parameter. A least-squares approach is used, along with the standard clean-type iterations.

# In CASA
clean(vis='SN_G55_10s.calib.ms', imagename='SN_G55_10s.MS.MFS',
      imsize=1280, cell='8arcsec', mode='mfs', nterms=2,
      multiscale=[0,6,10,30,60], 
      interactive=False, niter=1000,  weighting='briggs',
      stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')

viewer('SN_G55_10s.MS.MFS.image.tt0')

viewer('SN_G55_10s.MS.MFS.image.alpha')
MS-MFS Artifacts with nterms=2
  • nterms=2:the number of Taylor terms to be used to model the frequency dependence of the sky emission. Note that the speed of the algorithm will depend on the value used here (more terms will be slower); of course, the image fidelity will improve with a larger number of terms (assuming the sources are sufficiently bright to be modeled more completely).

This will take much longer than the two previous methods, so it would probably be a good time to have coffee or chat about EVLA data reduction with your neighbor at this point.

When clean is done <imagename>.image.tt0 will contain a total intensity image; <imagename>.image.alpha will contain an image of the spectral index in regions where there is sufficient signal-to-noise. For more information on the multi-frequency synthesis mode and its outputs, see the CASA cookbook. Inspect the brighter point sources in the field. You will notice that some of the artifacts which had been symmetric around the sources themselves are now gone; however, since we did not use W-projection this time, there are still strong features related to the non-coplanar baseline effects still apparent.

Multi-scale, multi-frequency, wide-field clean

Finally, we will combine the W-projection and MS-MFS algorithms to simultaneously account for both of the effects. Be forewarned -- these imaging runs will take a while, and it's best to start them running and then move on to other things. In testing, both of these runs (on the auto- and by-hand-flagged data) took around an hour.

First, we will image the autoflagged data. Using the same parameters for the individual-algorithm images above, but combined into a single clean run, we have:

# In CASA
clean(vis='G55.7+3.4.calib.ms', imagename='G55.7+3.4.MS.MFS.wProj',
      gridmode='widefield', imsize=1280, cell='8arcsec', mode='mfs',
      nterms=2, wprojplanes=128, multiscale=[0,6,10,30,60],  
      interactive=False, niter=1000,  weighting='briggs',
      stokes='I', threshold='0.1mJy', usescratch=F, imagermode='csclean')
viewer('G55.7+3.4.MS.MFS.wProj.image.tt0')
viewer('G55.7+3.4.MS.MFS.wProj.image.alpha')
artifacts with nterms=2, wide-field

Again, looking at the same outlier source, we can see that the major sources of error have been removed, although there are still some residual artifacts. One possible source of error is the time-dependent variation of the primary beam; another is the fact that we have only used nterms=2, which may not be sufficient to model the spectra of some of the point sources.

nterms=2, wide-field, auto-flagging
nterms=2, wide-field, by-hand flagging

We can compare the resulting image with one that was created from an MS that was flagged by hand, rather than with the automatic flagging routines. While it's clear that this is a superior image, the one that we have created with autoflagging is impressive, considering that the by-hand flagging took a number of weeks, and the autoflagging can be done in a matter of days (or hours, if one knows exactly what parameters to use).

Ultimately, it isn't too surprising that there was still some RFI present in our auto-flagged data, since we were able to see this with plotms. It's also possible that the auto-flagging overflagged some portions of the data, also leading to a reduction in the achievable image rms.


CASAguides

-- original: ??
--modifications: Lorant Sjouwerman (4.4.0, 2015/07/07)
--modifications: Jose Salcido (4.5.2, 2016/02/24)

Last checked on CASA Version 4.5.2