from casatasks.private.casa_transition import is_CASA6
from casatasks import casalog
from casatools import sidebandseparator, quanta
from taskinit import casalog
from taskinit import qatool as quanta
return casac.sidebandseparator()
def sdsidebandsplit(imagename, outfile, overwrite, signalshift, imageshift,
getbothside, refchan, refval, useother, threshold):
casalog.origin('sdsidebandsplit')
separator = sidebandseparator()
separator.open(imagename)
separator.setshift(signalshift, True)
separator.setshift(imageshift, False)
separator.setlimit(threshold)
separator.setboth(getbothside)
qrefval = myqa.quantity(refval)
separator.set_imageband_frequency(refchan, qrefval)
separator.setsolveother(useother)
separator.separate(outfile, overwrite)
# checking for CASA revision
if (string.find(a[k][1], 'ipython console') > 0):
myf=sys._getframe(stacklevel).f_globals
pkgrev = int(myf['casa']['build']['number'])
casalog.post("CASA version >= %d required for this interface"\
sbsep = sd.sbseparator(infiles)
# Set frequency information to select data
if not (qa.compare(freqtol, "Hz") or qa.quantity(freqtol)['unit'] == ''):
casalog.post("Invalid unit for frequency tolerance", "ERROR")
sbsep.set_frequency(ifno, freqtol, frame=frame)
# The format is checked cpp class
sbsep.set_shift(imageshift=imageshift)
# Set direction tolerance to grid data
# Set rejection limit of solution
sbsep.set_limit(threshold)
# Set which solution to get
sbsep.set_both(getbothside)
# Set information to get frequency information of image sideband
if getbothside and len(lo1) > 0:
if isinstance(reftime, str):
mereftime = myme.epoch('TAI', reftime)
reftime = mereftime['m0']['value']
sbsep.set_lo1(lo1, loframe, reftime, refdir)
sbsep.set_solve_other(False)
# Invoke separation supression
sbsep.separate(outfile, overwrite = overwrite)