In CASA 4.2 and earlier, the weights column in a data set do not reflect the relative channel widths between SPWs. This turns out to be important for the imaging of mixed mode data sets. For instance, if making an MFS continuum map combining TDM and FDM data, the FDM data would be given too high a weight by CLEAN unless the relative weights are corrected. You can learn more about this topic on CAS-5929.

To adjust the weights, follow this procedure

#  from recipes.weights import * 
#  adjustweights2(vis,field,spws)

As an example, adjustweights2(vis='',field='3',spws=[0,1,2,3]) will scale the weights for field 3 in science spws 0,1,2,3 (some of which are TDM, the rest FDM).

This function adjusts the weights for the specified field (specify only 1 at a time, and select by number, not name) and spws by a multiplicative factor of (2*df*dt/nchan), where df is the channel bandwidth, dt is the integration time (from the EXPOSURE column) and nchan is the number of channels in the spw.

  • Run it after splitting out what you want to image.
  • Run it only once on the split-out MS (it starts with the existing calibrated WEIGHT column and replaces it; once the original is lost it can't be redone)
  • Calibration solving should be ok as long as combine='spw' is NOT used (calibration treats WEIGHT as per-spw not per channel, and so these revised weights will not be relatively correct for combining spws for calibration solving)
    • Note that combine='spw' in solving for mixed-mode spws is already non-optimal for reasons similar to imaging.

This weight adjustment compensates for several things:

  • The fact that the weights have not been properly initialized with the 2*df*dt factor, which can vary with spw for mixed-mode observations.
  • Calibration of weights by applycal starts with 1/SIGMA^2, scales this by nchan (because SIGMA describes noise of individual channels and WEIGHT is supposed to describe the full spw bandwidth).
  • Clean effectively uses WEIGHT as if it were the single-channel weight.

The result is a WEIGHT column appropriate for imaging with clean.

  • In the case that you have only one EB, run this at the end of the scriptForCalibration, correcting the measurement set.
  • In the case that you have multiple EBs, run this at the end of the scriptForFluxCalibration, correcting the measurement set.

Special case: spectral and/or time averaging If you plan to use spectral and/or time averaging to create a smaller MS to speed up MFS imaging, you should create the averaged copy of the MS before you apply adjustweights2(). Then run adjustweights2() separately on the full-resolution MS and the averaged copy. This will result in two MSs (one full-resolution MS with adjusted weights and one averaged MS with adjusted weights) which can each be imaged correctly.

NOTE that spectral averaging with split does not change the weights. So if you spectrally average the FDM SPWs differently from the TDM SPWs and then want to combine them again, you have to account for this with an additional scaling due to the non-linear nature (in nchan) of the scaling factor in adjustweights2(). This can be done either in concat itself or using the scaleweights() method from the recipe.

Example with additional scaling after spectral averaging of the TDM data:

# splitting out the high-resolution dataset and rebinning it to speed up imaging

# high resolution
split(vis = '',
  outputvis = '',
  timebin = '30s',
  datacolumn = 'data',
  width = 30, # spectral averaging of only the FDM data over 30 channels
  spw = '0',
  field = '3')

# low resolution
split(vis = '',
  outputvis = '',
  timebin = '30s',
  datacolumn = 'data',
  spw = '1,2,3',
  field = '3')

# concatenation, using a weight that accounts for the re-binning of the high resolution data
concat(vis = ['', ''],
  concatvis = '', visweightscale = [1/30., 1]) # additional scaling by factor 1/30 for the first MS (the FDM data)

adjustweights2(vis='', field=0, spws=[0,1,2,3])

-- ScottSchnee - 2014-01-14
Topic revision: r5 - 2014-01-23, ScottSchnee
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback