#include <casa/BasicSL/Constants.h>
#include <casa/Logging/LogSink.h>
#include <casa/Logging/LogMessage.h>
#include <casa/Arrays/ArrayMath.h>
#include <casa/Arrays/Slice.h>
#include <images/Images/ImageExpr.h>
#include <imageanalysis/ImageAnalysis/ImagePolarimetry.h>
#include <imageanalysis/Images/ComponentListImage.h>
#include <images/Images/ImageBeamSet.h>
#include <synthesis/MeasurementEquations/ClarkCleanProgress.h>
#include <lattices/LatticeMath/LatticeCleanProgress.h>
#include <msvis/MSVis/VisSet.h>
#include <msvis/MSVis/VisSetUtil.h>
#include <msvis/MSVis/VisImagingWeight.h>
#include <msvis/MSVis/SubMS.h>
// Disabling Imager::correct() (gmoellen 06Nov20)
//#include <synthesis/MeasurementComponents/TimeVarVisJones.h>
// Get initial image and/or SkyComponents
if(!Table::isReadable(incomps)) {
os << LogIO::SEVERE << "ComponentList " << incomps
<< " not readable" << LogIO::EXCEPTION;
inComps_pointer = new ComponentList(incomps);
outComps_pointer = new ComponentList( inComps_pointer->copy() );
//outComps_pointer = new ComponentList( inComps_pointer->copy() );
if(!Table::isReadable(inimage)) {
os << LogIO::SEVERE << "Image " << inimage << " not readable"
inImage_pointer = new PagedImage<Float>( inimage );
// Do components (if indeed we have any)
if (inComps_pointer!=0) {
if (inImage_pointer==0) {
"No input image was given for the componentList to get the frequency from"
Int ncomponents = inComps_pointer->nelements();
outComps_pointer = new ComponentList();
for (Int icomp=0;icomp<ncomponents;++icomp) {
SkyComponent component=outComps_pointer->component(icomp);
SkyComponent component=(inComps_pointer->component(icomp)).copy();
if (operation=="apply") {
myPBp->applyPB(component, component, pointingCenter,
qFreq, pa, squintType_p, false);
myPBp->applyPB(component, component, pointingCenter,
qFreq, pa, squintType_p, true);
outComps_pointer->add(component);
ComponentListImage clImage(*outComps_pointer, outImage_pointer->coordinates(), outImage_pointer->shape());
outImage_pointer->copyData(LatticeExpr<Float>((*outImage_pointer)+clImage));
if (inImage_pointer) delete inImage_pointer;
if (outImage_pointer) delete outImage_pointer;
if (inComps_pointer) delete inComps_pointer;
if (outComps_pointer) delete outComps_pointer;