Source
# casalog.post("Please check the casa log file for a message confirming that the model was saved after the last major cycle. If it doesn't exist, please re-run tclean with niter=0,calcres=False,calcpsf=False in order to trigger a 'predict model' step that obeys the savemodel parameter.","WARN","task_tclean")
################################################
# Refactored Clean task
#
# v1.0: 2012.10.05, U.R.V.
#
################################################
from __future__ import absolute_import
import os
import shutil
import numpy
import copy
import filecmp
import time
# get is_CASA6 and is_python3
from casatasks.private.casa_transition import *
from casatasks import casalog
from casatasks.private.imagerhelpers.imager_base import PySynthesisImager
from casatasks.private.imagerhelpers.input_parameters import saveparams2last
from casatasks.private.imagerhelpers.imager_parallel_continuum import PyParallelContSynthesisImager
from casatasks.private.imagerhelpers.imager_parallel_cube import PyParallelCubeSynthesisImager
from casatasks.private.imagerhelpers.input_parameters import ImagerParameters
from casatasks.private.imagerhelpers.imager_return_dict import ReturnDictionary
from .cleanhelper import write_tclean_history, get_func_params
from casatools import table
from casatools import image
from casatools import synthesisutils
from casatools import synthesisimager
try:
if is_CASA6:
from casampi.MPIEnvironment import MPIEnvironment
from casampi import MPIInterface
else:
from mpi4casa.MPIEnvironment import MPIEnvironment
from mpi4casa import MPIInterface
mpi_available = True
except ImportError:
mpi_available = False
#if you want to save tclean.last.* from python call of tclean uncomment the decorator
#@saveparams2last(multibackup=True)
def tclean(
####### Data Selection
vis,#='',
selectdata,
field,#='',
spw,#='',
timerange,#='',
uvrange,#='',
antenna,#='',
scan,#='',
observation,#='',
intent,#='',
datacolumn,#='corrected',
####### Image definition
imagename,#='',
imsize,#=[100,100],
cell,#=['1.0arcsec','1.0arcsec'],
phasecenter,#='J2000 19:59:28.500 +40.44.01.50',
stokes,#='I',
projection,#='SIN',
startmodel,#='',
## Spectral parameters
specmode,#='mfs',
reffreq,#='',
nchan,#=1,
start,#='',
width,#='',
outframe,#='LSRK',
veltype,#='',
restfreq,#=[''],
# sysvel,#='',
# sysvelframe,#='',
interpolation,#='',
perchanweightdensity, #=''
##
####### Gridding parameters
gridder,#='ft',
facets,#=1,
psfphasecenter,#='',
wprojplanes,#=1,
### PB
vptable,