from __future__ import absolute_import
from casatasks.private.casa_transition import *
from casatools import mstransformer as mttool
from casatools import ms as mstool
from casatools import table as tbtool
from casatasks import casalog
from .parallel.parallel_data_helper import ParallelDataHelper
from .mstools import write_history
from taskinit import casalog, mttool, tbtool, mstool
from mstools import write_history
from parallel.parallel_data_helper import ParallelDataHelper
""" This task used the MSTransform framework. It needs to use the ParallelDataHelper
class, implemented in parallel.parallel_data_helper.py.
assert outputvis != '', "Must provide output data set name in parameter outputvis."
assert not os.path.exists(outputvis), "Output MS %s already exists - will not overwrite." % outputvis
assert not os.path.exists(outputvis+".flagversions"), \
"The flagversions \"%s.flagversions\" for the output MS already exist. Please delete." % outputvis
pdh = ParallelDataHelper("cvel2", locals())
if pdh.isMMSAndNotServer(vis) and keepmms:
retval = pdh.validateInputParams()
raise RuntimeError('Unable to continue with MMS processing')
pdh.setupCluster('cvel2')
config = pdh.setupParameters(inputms=vis, outputms=outputvis, field=field,
spw=spw, array=array, scan=scan, antenna=antenna, correlation=correlation,
uvrange=uvrange,timerange=timerange, intent=intent, observation=observation,