Source
#casalog.post("Model visibilities may not have been saved in the MS even though you have asked for it. Please check the logger for the phrases 'Run (Last) Major Cycle' and '" + wstr +"'. If these do not appear, then please save the model via a separate tclean run with niter=0,calcres=F,calcpsf=F. It will pick up the existing model from disk and save/predict it. Reason for this : For performance reasons model visibilities are saved only in the last major cycle. If the X button on the interactive GUI is used to terminate a run before this automatically detected 'last' major cycle, the model isn't written. However, a subsequent tclean run as described above will predict and save the model. ","WARN")
from __future__ import absolute_import
import os
import math
import shutil
import string
import time
import re
import copy
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from casatools import synthesisimager, synthesisdeconvolver, synthesisnormalizer, iterbotsink, ctsys, table, image
from casatasks import casalog
from casatasks.private.imagerhelpers.summary_minor import SummaryMinor
ctsys_hostinfo = ctsys.hostinfo
_tb = table()
_ia = image()
else:
from taskinit import *
from imagerhelpers.summary_minor import SummaryMinor
synthesisimager = casac.synthesisimager
synthesisdeconvolver = casac.synthesisdeconvolver
synthesisnormalizer = casac.synthesisnormalizer
# make it look like the CASA6 version even though it's using the CASA5 named tool not present in CASA6
iterbotsink = casac.synthesisiterbot
ctsys_hostinfo = casac.cu.hostinfo
_tb = tb
'''
A set of helper functions for tclean.
Summary...
'''
#############################################
class PySynthesisImager:
def __init__(self,params):
################ Tools
self.initDefaults()
# Check all input parameters, after partitioning setup.
# Selection Parameters. Dictionary of dictionaries, indexed by 'ms0','ms1',...
self.allselpars = params.getSelPars()
# Imaging/Deconvolution parameters. Same for serial and parallel runs
self.alldecpars = params.getDecPars()
self.allimpars = params.getImagePars()
self.allgridpars = params.getGridPars()
self.allnormpars = params.getNormPars()
self.weightpars = params.getWeightPars()
# Iteration parameters
self.iterpars = params.getIterPars() ## Or just params.iterpars
# CFCache params
self.cfcachepars = params.getCFCachePars()
## Number of fields ( main + outliers )
self.NF = len(self.allimpars.keys())
self.stopMinor = {} ##[0]*self.NF