from __future__ import absolute_import
from casatasks.private.casa_transition import is_CASA6
from casatools import quanta, ms, image, table, msmetadata
from casatasks import casalog
from .cleanhelper import cleanhelper
from taskinit import casalog
from taskinit import msmdtool as msmetadata
from taskinit import tbtool as table
from taskinit import mstool as ms
from taskinit import iatool as image
from taskinit import qatool as quanta
from cleanhelper import cleanhelper
def sdimaging(infiles, outfile, overwrite, field, spw, antenna, scan, intent,
mode, nchan, start, width, veltype, outframe,
gridfunction, convsupport, truncate, gwidth, jwidth,
imsize, cell, phasecenter, projection, ephemsrcname,
pointingcolumn, restfreq, stokes, minweight, brightnessunit, clipminmax):
with sdutil.sdtask_manager(sdimaging_worker, locals()) as worker:
Returns True if the argument is string type.
return type(val) in [str, numpy.string_]
class sdimaging_worker(sdutil.sdtask_template_imaging):
def __init__(self, **kwargs):
super(sdimaging_worker,self).__init__(**kwargs)
def parameter_check(self):
sdutil.assert_outfile_canoverwrite_or_nonexistent(self.outfile,
sdutil.assert_outfile_canoverwrite_or_nonexistent(self.outfile+'.weight',
if type(self.spw) == str:
self.spw = self.__format_spw_string(self.spw)
if self.mode == 'channel':
if self.start == '': self.start = 0
if self.width == '': self.width = 1
if self.start == 0: self.start = ''
if self.width == 1: self.width = ''
if self.mode == 'frequency':
elif self.mode == 'velocity':
for name in ['start', 'width']:
param = getattr(self, name)
new_param = self.__format_quantum_unit(param, myunit)
raise ValueError("Invalid unit for %s in mode %s: %s" % \