from parallel.parallel_task_helper import ParallelTaskHelper
def initweights(vis=None,wtmode=None,tsystable=None,gainfield=None,interp=None,spwmap=None,dowtsp=None):
casalog.origin('initweights')
if ParallelTaskHelper.isMPIEnabled() and ParallelTaskHelper.isParallelMS(vis):
helper = ParallelTaskHelper('initweights', locals())
param_names = initweights.func_code.co_varnames[:initweights.func_code.co_argcount]
param_vals = [eval(p) for p in param_names]
casalog.post('Updating the history in the output', 'DEBUG1')
write_history(ms, vis, 'initweights', param_names,
except Exception, instance:
casalog.post("*** Error \'%s\' updating HISTORY" % (instance),
if ((type(vis)==str) & (os.path.exists(vis))):
if wtmode.upper().find("TSYS") > -1:
if not os.path.exists(tsystable):
raise Exception, 'Tsys calibration table %s not found' % tsystable
mycb.open(vis,compress=False,addcorr=False,addmodel=False)
mycb.initweights(wtmode=wtmode,dowtsp=dowtsp,tsystable=tsystable,gainfield=gainfield,interp=interp,spwmap=spwmap)
raise Exception, 'Visibility data set not found - please verify the name'
if ParallelTaskHelper.isMPIClient():
param_names = initweights.func_code.co_varnames[:initweights.func_code.co_argcount]
param_vals = [eval(p) for p in param_names]
casalog.post('Updating the history in the output', 'DEBUG1')
write_history(myms, vis, 'initweights', param_names,
except Exception, instance:
casalog.post("*** Error \'%s\' updating HISTORY" % (instance),