from taskinit import mstool, tbtool, casalog, write_history
def oldstatwt(vis, dorms, byantenna, sepacs, fitspw, fitcorr, combine,
timebin, minsamp, field, spw, antenna, timerange, scan, intent,
array, correlation, obs, datacolumn):
Sets WEIGHT and SIGMA using the scatter of the visibilities.
casalog.origin('oldstatwt')
casalog.post("The oldstatwt task is deprecated in CASA version 5.8 and is not present in CASA 6.2. Please use task statwt instead.",'WARN')
raise ValueError("byantenna=True is not supported yet")
raise ValueError("fitcorr is not supported yet")
if timebin !='0s' and timebin !='-1s':
raise ValueError("timebin is not supported yet")
colnames = mytb.colnames()
for datacol in ['CORRECTED_DATA', 'DATA', 'junk']:
raise ValueError(vis + " does not have a data column")
if datacolumn == 'float_data':
raise ValueError("float_data is not yet supported")
if datacolumn == 'corrected' and datacol == 'DATA':
casalog.post("No %s column found, using %s column" % (datacolumn.upper()+'_DATA', datacol),'WARN')
if datacolumn=='corrected':
datacolumn_name=datacolumn.upper()+'_DATA'
datacolumn_name=datacolumn.upper()
casalog.post("Using %s column to determine visibility scatter" % datacolumn_name)
casalog.post('The channel selection part of spw will be ignored.', 'WARN')
casalog.post('Correlation selection in oldstatwt has been disabled as of CASA v4.5', 'WARN')
myms.open(vis, nomodify=False)
retval = myms.oldstatwt(dorms, byantenna, sepacs, fitspw, fitcorr, combine,
timebin, minsamp, field, spw, antenna, timerange, scan, intent,
array, correlation, obs, datacolumn)
casalog.post("Error setting WEIGHT and SIGMA for %s:" % vis, 'SEVERE')