Source
380
380
##### Iteration control
381
381
niter,#=0,
382
382
gain,#=0.1,
383
383
threshold,#=0.0,
384
384
nsigma,#=0.0
385
385
cycleniter,#=0,
386
386
cyclefactor,#=1.0,
387
387
minpsffraction,#=0.1,
388
388
maxpsffraction,#=0.8,
389
389
interactive,#=False,
390
+
nmajor,#=-1,
390
391
391
392
##### (new) Mask parameters
392
393
usemask,#='user',
393
394
mask,#='',
394
395
pbmask,#='',
395
396
# maskthreshold,#='',
396
397
# maskresolution,#='',
397
398
# nmask,#=0,
398
399
399
400
##### automask by multithresh
488
489
casalog.post("Currently, only the multi-term MFS algorithm is supported for specmode=mfs. To make a single plane MFS image (while retaining the frequency dependence for the cube major cycle stage), please pick nterms=1 along with deconvolver=mtmfs. The scales parameter is still usable for multi-scale multi-term deconvolution","WARN","task_sdintimaging")
489
490
return;
490
491
491
492
if(gridder=='awproject'):
492
493
casalog.post("The awproject gridder is temporarily not supported with cube major cycles. Support will be brought back in a subsequent release.","WARN","task_sdintimaging")
493
494
return;
494
495
495
496
if(usedata=='sd'):
496
497
casalog.post("The Single-Dish-Only mode of sdintimaging is better supported via the deconvolve task which supports spectral cube, mfs and multi-term mfs deconvolution in the image domain alone. The deconvolve task is the more appropriate version to use for stand-alone image-domain deconvolution, and will not have the bookkeeping overheads currently present in the sdintimaging task's sd-only mode. Please note that the 'sd' option of the sdintimaging task will be removed in a subsequent release. Please refer to the task deconvolve documentation for instructions on how to prepare image and psf cubes for the deconvolve task for all these modes.","WARN","task_sdintimaging");
497
498
499
+
if (nmajor < -1):
500
+
casalog.post("Negative values less than -1 for nmajor are reserved for possible future implementation", "WARN", "task_sdintimaging")
501
+
return
502
+
498
503
499
504
# if parallel==True:
500
505
# casalog.post("Cube parallelization (all major cycles) is currently not supported via task_sdintimaging. This will be enabled after a cube parallelization rework.")
501
506
# return;
502
507
503
508
#####################################################
504
509
#### Construct ImagerParameters object
505
510
#####################################################
506
511
507
512
imager = None
730
735
chanwt=inpparams['chanwt'],
731
736
action='mult', pblimit=pblimit, freqdep=True)
732
737
733
738
## Major cycle for interferometer data
734
739
t0=time.time();
735
740
# print('Max of int residual before major cycle' + str(imstat(int_cube+'.residual',verbose=False)['max'][0]))
736
741
# print('Max of int model before major cycle' + str(imstat(int_cube+'.model',verbose=False)['max'][0]))
737
742
738
743
if usedata != "sd":
739
744
imager.runMajorCycle()
745
+
# track nmajor for the deconvolvertool.hasConverged() method
746
+
deconvolvertool.majorCnt = imager.majorCnt
747
+
740
748
# print('Max of int residual after major cycle' + str(imstat(int_cube+'.residual',verbose=False)['max'][0]))
741
749
t1=time.time();
742
750
casalog.post("***Time for major cycle: "+"%.2f"%(t1-t0)+" sec", "INFO3", "task_tclean");
743
751
744
752
if usedata!="int":
745
753
## Major cycle for Single Dish data (uses the flat sky cube model in sd_cube.model )
746
754
sdintlib.calc_sd_residual(origcube=sd_cube+'.image',
747
755
modelcube=sd_cube+'.model',
748
756
residualcube=sd_cube+'.residual', ## output
749
757
psfcube=sd_cube+'.psf')