Source
import os
import shutil
import numpy
import pdb
from taskinit import *
from cleanhelper import *
im,cb,ms,tb,me,ia,po,sm,cl,cs,rg,sl,dc,vp,msmd,fi,fn,imd,sdms=gentools(['im','cb','ms','tb','me','ia','po','sm','cl','cs','rg','sl','dc','vp','msmd','fi','fn','imd','sdms'])
def clean(vis, imagename,outlierfile, field, spw, selectdata, timerange,
uvrange, antenna, scan, observation, intent, mode, resmooth,gridmode,
wprojplanes, facets, cfcache, rotpainc, painc, aterm, psterm, mterm, wbawp, conjbeams,
epjtable, interpolation,
niter, gain, threshold, psfmode, imagermode, ftmachine, mosweight,
scaletype, multiscale, negcomponent, smallscalebias,
interactive, mask, nchan, start, width, outframe,
veltype, imsize, cell, phasecenter, restfreq, stokes, weighting,
robust, uvtaper, outertaper, innertaper, modelimage, restoringbeam,
pbcor, minpb, usescratch, noise, npixels, npercycle, cyclefactor,
cyclespeedup, nterms, reffreq, chaniter, flatnoise, allowchunk):
#Python script
casalog.origin('clean')
## CAS-12368
depstr = "**** Task clean is deprecated in CASA 5.8 and is not present in CASA 6.2. Please use tclean instead. All major functionality from clean is present in tclean via a modified interface along with additional algorithmic options and parallelization options. ****"
casalog.post(depstr, 'WARN')
print depstr
casalog.post('nchan='+str(nchan)+' start='+str(start)+' width='+str(width))
#If using new FT-Machines, do not use the on-the-fly model_data columns.
# if (gridmode == 'advancedaprojection'):
# raise Exception, 'This mode is not yet ready for use'
if gridmode == 'advancedaprojection' and usescratch==False:
casalog.post('Forcing usescratch=True for new FTMs. This is temporary.', 'WARN')
usescratch=True
#######################################################################
#
# start of the big cube treatment
#
#######################################################################
#paralist=[vis, imagename,outlierfile, field, spw, selectdata, \
# timerange, uvrange, antenna, scan, observation, intent, mode, gridmode, \
# wprojplanes, facets, cfcache, painc, epjtable, \
# interpolation, niter, gain, threshold, psfmode, \
# imagermode, ftmachine, mosweight, scaletype, multiscale, \
# negcomponent, smallscalebias, interactive, mask, nchan, \
# start, width, outframe, veltype, imsize, cell, \
# phasecenter, restfreq, stokes, weighting, \
# robust, uvtaper, outertaper, innertaper, modelimage, \
# restoringbeam, pbcor, minpb, calready, noise, npixels, \
# npercycle, cyclefactor, cyclespeedup, nterms, reffreq, \
# chaniter, flatnoise, allowchunk]
#print paralist
if (spw==''):
spw='*';
if allowchunk and (mode=='velocity' or mode=='frequency' or mode=='channel') \
and not interactive:
casalog.post('analysing intended channalization...')
imCln=imtool()