import numpy.random as random
from casatasks import casalog
from casatools import calibrater, ms, table
from .mstools import write_history
def sdcal(infile=None, calmode='tsys', fraction='10%', noff=-1,
width=0.5, elongated=False, applytable='', interp='', spwmap={},
outfile='', overwrite=False, field='', spw='', scan='', intent=''):
"""Externally specify calibration solutions of various types."""
handle_composite_mode(locals())
raise UserWarning("Scan input must be ''(=all) in calmode='tsys'.")
raise UserWarning("Spw input must be ''(=all) in calmode='tsys'.")
if isinstance(infile, str) and os.path.exists(infile):
addcorr = calmode == 'apply'
cb.open(filename=infile, compress=False, addcorr=addcorr, addmodel=False)
cb.selectvis(spw=spw, scan=scan, field=field)
raise Exception('Infile data set not found - please verify the name')
if not isinstance(calmode, str):
raise Exception("Calmode must be a string")
if calmode.lower() not in ['tsys', 'ps', 'otfraster', 'otf', 'apply']:
"Calmode must be either 'ps' or 'otfraster' or 'otf' or 'tsys' or 'apply'.")
if (not overwrite) and os.path.exists(outfile):
raise RuntimeError("overwrite is False and output file exists: {}".format(outfile))
if isinstance(applytable, str):
_table_list = [applytable]