from __future__ import absolute_import
from casatasks.private.casa_transition import *
from casatools import ms as mstool
from casatasks import casalog
from .mstools import write_history
from taskinit import mstool, casalog
from mstools import write_history
def uvsub(vis=None,reverse=False):
"""Subtract model from the corrected visibility data
uvsub(vis='ngc5921.ms', reverse=false)
This function subtracts model visibility data from corrected visibility
data leaving the residuals in the corrected data column. If the
parameter 'reverse' is set true, the process is reversed.
vis -- Name of input visibility file (MS)
default: none; example: vis='ngc5921.ms'
reverse -- Reverse the operation (add rather than subtract)
default: false; example: reverse=true
uvsub(vis='ngc5921.ms', reverse=false)
if ((type(vis)==str) & (os.path.exists(vis))):
_ms.open(thems=vis,nomodify=False)
raise ValueError('Visibility data set not found - please verify the name')
param_names = uvsub.__code__.co_varnames[:uvsub.__code__.co_argcount]
param_vals = [vars[p] for p in param_names]
param_vals = [eval(p) for p in param_names]
write_history(mstool(), vis, 'uvsub', param_names,
except Exception as instance:
casalog.post("*** Error \'%s\' updating HISTORY" % (instance),