from casatasks import casalog
from casatools import ms as mstool
from casatools import singledishms, table
from .mstools import write_history
@sdutil.callable_sdtask_decorator
def sdsmooth(infile=None, datacolumn=None, antenna=None,
field=None, spw=None, timerange=None, scan=None,
pol=None, intent=None, reindex=None,
kernel=None, kwidth=None,
outfile=None, overwrite=None):
errmsg = 'outfile is empty.'
if (os.path.exists(outfile)) and (not overwrite):
errmsg = outfile + ' exists.'
sdms.set_selection(spw=spw, field=field,
timerange=timerange, scan=scan,
polarization=pol, intent=intent,
sdms.smooth(type=kernel, width=kwidth, datacolumn=datacolumn, outfile=outfile)
param_names = sdsmooth.__code__.co_varnames[:sdsmooth.__code__.co_argcount]
param_vals = [vars[p] for p in param_names]
write_history(ms, outfile, 'sdsmooth', param_names,