Build: #2 was successful

Job: Tag Branch for Packages was successful

Stages & jobs

  1. Tag Branch

  2. Default Stage

  3. Create Critial Test Plan Branch

Build log

The build generated 2,802 lines of output.The output is too long and has been truncated to the last 1,000 lines. Download or view full build log.

22-Apr-2019 15:38:11 -        nw = wVals.nelements();
22-Apr-2019 15:38:11 -        //        nCFFreq = fVals.nelements()-1;
22-Apr-2019 15:38:11 +        cfb = (*vb2CFBMap_p)[irow];
22-Apr-2019 15:38:11         
22-Apr-2019 15:38:11         for (Int ichan=0; ichan < nDataChan; ichan++) {
22-Apr-2019 15:38:11           achan=chanMap_p[ichan];
22-Apr-2019 15:38:11          
22-Apr-2019 15:38:11           if((achan>=0) && (achan<nGridChan)) {
22-Apr-2019 15:38:11 -            //            lambda = C::c/freq[ichan];
22-Apr-2019 15:38:11             Double dataWVal = (vbs.vb_p->uvw()(2,irow));
22-Apr-2019 15:38:11 -            Int wndx = cfb.nearestWNdx(abs(dataWVal)*freq[ichan]/C::c);
22-Apr-2019 15:38:11 -            //Int fndx = cfb.nearestFreqNdx(freq[ichan]);
22-Apr-2019 15:38:11 -            Int fndx = cfb.nearestFreqNdx(vbSpw,ichan);
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -            //            cerr << "DG: " << fndx << " " << wndx << " " << ichan << " " << vbSpw << " " << freq[ichan] << endl;
22-Apr-2019 15:38:11 -           
22-Apr-2019 15:38:11 -            //            cerr << "Grid: " << ichan << " " << freq[ichan] << " " << fndx << endl;
22-Apr-2019 15:38:11 -           
22-Apr-2019 15:38:11 -            // if (nw > 1) wndx=SynthesisUtils::nint((dataWVal*freq[ichan]/C::c)/wIncr-1);
22-Apr-2019 15:38:11 -            // if (nCFFreq > 0) fndx = SynthesisUtils::nint((freq[ichan])/fIncr-1);
22-Apr-2019 15:38:11 +            Int wndx = cfb->nearestWNdx(abs(dataWVal)*freq[ichan]/C::c);
22-Apr-2019 15:38:11 +            Int fndx = cfb->nearestFreqNdx(vbSpw,ichan);
22-Apr-2019 15:38:11             Float s;
22-Apr-2019 15:38:11 -            // CoordinateSystem cs;
22-Apr-2019 15:38:11 -            // cfb.getParams(cs,s,support(0),support(1),0,wndx,0);
22-Apr-2019 15:38:11 -            cfb.getParams(cfRefFreq,s,support(0),support(1),fndx,wndx,0);
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11 +            cfb->getParams(cfRefFreq,s,support(0),support(1),fndx,wndx,0);
22-Apr-2019 15:38:11             sampling(0) = sampling(1) = SynthesisUtils::nint(s);
22-Apr-2019 15:38:11            
22-Apr-2019 15:38:11 -            //cfScale = cfRefFreq/freq[ichan];
22-Apr-2019 15:38:11 -           
22-Apr-2019 15:38:11 -            // sampling[0] = SynthesisUtils::nint(sampling[0]*cfScale);
22-Apr-2019 15:38:11 -            // sampling[1] = SynthesisUtils::nint(sampling[1]*cfScale);
22-Apr-2019 15:38:11 -            // support[0]  = SynthesisUtils::nint(support[0]/cfScale);
22-Apr-2019 15:38:11 -            // support[1]  = SynthesisUtils::nint(support[1]/cfScale);
22-Apr-2019 15:38:11 -           
22-Apr-2019 15:38:11             sgrid(pos,loc,off,phasor,irow,uvw,dphase_p[irow],freq[ichan],
22-Apr-2019 15:38:11                   uvwScale_p,offset_p,sampling);
22-Apr-2019 15:38:11            
22-Apr-2019 15:38:11 -            //            iloc[2]=max(0, min(nw, loc[2]));
22-Apr-2019 15:38:11 -           
22-Apr-2019 15:38:11             Bool isOnGrid;
22-Apr-2019 15:38:11             //  if ((isOnGrid=onGrid(nx, ny, nw, loc, support)))
22-Apr-2019 15:38:11             {
22-Apr-2019 15:38:11 @@ -871,7 +833,6 @@ namespace casa{
22-Apr-2019 15:38:11                               // Set the polarization plane of the gridded data to use for predicting with the CF from mCols column
22-Apr-2019 15:38:11                               visGridElement=(int)(muellerElement%nDataPol);
22-Apr-2019 15:38:11                               igrdpos[2]=polMap_p[visGridElement];
22-Apr-2019 15:38:11 -                              //cerr << "DG: " << mCol << "-->" << visGridElement << "-->" << ipol << " " << polMap_p[ipol] << " " << polMap_p[visGridElement] << endl;
22-Apr-2019 15:38:11                               //
22-Apr-2019 15:38:11                               // Compute the incrmenets and center pixel for the current CF
22-Apr-2019 15:38:11                               //
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/AWVisResampler.h b/code/synthesis/TransformMachines2/AWVisResampler.h
22-Apr-2019 15:38:11 index 6c7dff4..2eddfc4 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/AWVisResampler.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/AWVisResampler.h
22-Apr-2019 15:38:11 @@ -284,14 +284,14 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11      // EVLA and ALMA, this is not useful.  Leaving it hear for now....
22-Apr-2019 15:38:11      //
22-Apr-2019 15:38:11      casacore::Bool reindex(const casacore::Vector<casacore::Int>& in, casacore::Vector<casacore::Int>& out,
22-Apr-2019 15:38:11 -                 const casacore::Double& sinDPA, const casacore::Double& cosDPA,
22-Apr-2019 15:38:11 -                 const casacore::Vector<casacore::Int>& Origin, const casacore::Vector<casacore::Int>& size);
22-Apr-2019 15:38:11 +                           const casacore::Double& sinDPA, const casacore::Double& cosDPA,
22-Apr-2019 15:38:11 +                           const casacore::Vector<casacore::Int>& Origin, const casacore::Vector<casacore::Int>& size);
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 - casacore::Complex* getConvFunc_p(const double& vbPA,
22-Apr-2019 15:38:11 +    casacore::Complex* getConvFunc_p(const double& vbPA,
22-Apr-2019 15:38:11                                      casacore::Vector<casacore::Int>& cfShape,
22-Apr-2019 15:38:11                                      casacore::Vector<int>& support,
22-Apr-2019 15:38:11                                      int& muellerElement,
22-Apr-2019 15:38:11 -                                     CFBuffer& cfb,
22-Apr-2019 15:38:11 +                                     CountedPtr<CFBuffer>& cfb,
22-Apr-2019 15:38:11                                      casacore::Double& wVal, casacore::Int& fndx,
22-Apr-2019 15:38:11                                      casacore::Int& wndx,
22-Apr-2019 15:38:11                                      PolMapType& mNdx, PolMapType& conjMNdx,
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/CFBuffer.cc b/code/synthesis/TransformMachines2/CFBuffer.cc
22-Apr-2019 15:38:11 index cd579de..21132d4 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/CFBuffer.cc
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/CFBuffer.cc
22-Apr-2019 15:38:11 @@ -630,16 +630,8 @@ namespace casa{
22-Apr-2019 15:38:11        }
22-Apr-2019 15:38:11      //        st.CFBStorage[i] = (cfstore[i]).operator->()->getStorage()->getStorage(dummy);
22-Apr-2019 15:38:11      
22-Apr-2019 15:38:11 -    // if (doAlloc) st.pointingOffset=(Double *)malloc(pointingOffset_p.nelements()*sizeof(Double));
22-Apr-2019 15:38:11 +    // if (doAlloc) st.pointingOffset=(Double *)malloc(pointingOffset_p.nelements()*sizeof(Double));
22-Apr-2019 15:38:11      // for (uInt i=0;i<pointingOffset_p.nelements();i++) st.pointingOffset[i]=pointingOffset_p[i];
22-Apr-2019 15:38:11 -    // I am modifying it to allocate for a vector of vectors
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -    // if (doAlloc) st.pointingOffset=(Double *)malloc(pointingOffset_p.nelements()*pointingOffset_p(0).nelements()*sizeof(Double));
22-Apr-2019 15:38:11 -    // for (uInt i=0;i<pointingOffset_p.nelements();i++)
22-Apr-2019 15:38:11 -    //   {
22-Apr-2019 15:38:11 -    //         for (uInt j=0;j<pointingOffset_p(0).nelements();j++)
22-Apr-2019 15:38:11 -    //           st.pointingOffset[i][j]=pointingOffset_p[i][j];
22-Apr-2019 15:38:11 -    //   }
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      if (doAlloc) st.freqValues=(Double *)malloc(freqValues_p.nelements()*sizeof(Double));
22-Apr-2019 15:38:11      for (uInt i=0;i<freqValues_p.nelements();i++) st.freqValues[i]=freqValues_p[i];
22-Apr-2019 15:38:11 @@ -720,8 +712,16 @@ namespace casa{
22-Apr-2019 15:38:11      
22-Apr-2019 15:38:11      return maxCFSize_p;
22-Apr-2019 15:38:11    }
22-Apr-2019 15:38:11 +  //
22-Apr-2019 15:38:11 +  //----------------------------------------------------------------------
22-Apr-2019 15:38:11 +  //
22-Apr-2019 15:38:11 +  bool CFBuffer::finitePointingOffsets()
22-Apr-2019 15:38:11 +  {
22-Apr-2019 15:38:11 +    return ((fabs(pointingOffset_p(0)(0))>0) || 
22-Apr-2019 15:38:11 +            (fabs(pointingOffset_p(0)(1))>0));
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 +  }
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 } // end casa namespace
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/CFBuffer.h b/code/synthesis/TransformMachines2/CFBuffer.h
22-Apr-2019 15:38:11 index c31e853..1abf474 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/CFBuffer.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/CFBuffer.h
22-Apr-2019 15:38:11 @@ -252,7 +252,7 @@ using namespace casa::vi;
22-Apr-2019 15:38:11      inline casacore::Int nearestWNdx(const casacore::Double& wVal)
22-Apr-2019 15:38:11      {
22-Apr-2019 15:38:11        //      return SynthesisUtils::nint(sqrt(wValIncr_p*abs(wVal)));
22-Apr-2019 15:38:11 -      return max(0,min((int)(sqrt(wValIncr_p*abs(wVal))),(int)wValues_p.nelements())-1);
22-Apr-2019 15:38:11 +      return max(0,min((SynthesisUtils::nint)(sqrt(wValIncr_p*abs(wVal))),(int)wValues_p.nelements())-1);
22-Apr-2019 15:38:11        // Int ndx=(int)(sqrt(wValIncr_p*abs(wVal)));
22-Apr-2019 15:38:11        // if ((uInt)ndx >= wValues_p.nelements())
22-Apr-2019 15:38:11        //         cerr << endl << endl << ndx << " " <<  wVal << " " << wValIncr_p << endl << endl;
22-Apr-2019 15:38:11 @@ -326,9 +326,9 @@ using namespace casa::vi;
22-Apr-2019 15:38:11                                                       const casacore::Float& diameter=25.0);
22-Apr-2019 15:38:11      // casacore::RigidVector<casacore::Int, 3> setParams(const casacore::Int& inu, const casacore::Int& iw, const casacore::Int& muellerElement,
22-Apr-2019 15:38:11      //                                   const casacore::TableRecord& miscInfo);
22-Apr-2019 15:38:11 -    void setPointingOffset(const casacore::Vector<casacore::Vector<casacore::Double> > & offset)
22-Apr-2019 15:38:11 +    void setPointingOffset(const casacore::Vector<casacore::Vector<casacore::Double> >& offset)
22-Apr-2019 15:38:11      {pointingOffset_p.assign(offset);};
22-Apr-2019 15:38:11 -    casacore::Vector<casacore::Vector<casacore::Double> >getPointingOffset() {return pointingOffset_p;};
22-Apr-2019 15:38:11 +    casacore::Vector<casacore::Vector<casacore::Double> > getPointingOffset() {return pointingOffset_p;};
22-Apr-2019 15:38:11      //
22-Apr-2019 15:38:11      // Also set the size of the CF in x and y.
22-Apr-2019 15:38:11      //
22-Apr-2019 15:38:11 @@ -408,6 +408,7 @@ using namespace casa::vi;
22-Apr-2019 15:38:11      casacore::IPosition getShape() {return cfCells_p.shape();}
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      int getMaxCFSize();
22-Apr-2019 15:38:11 +    bool finitePointingOffsets();
22-Apr-2019 15:38:11      //
22-Apr-2019 15:38:11      //============================= Protected Parts ============================
22-Apr-2019 15:38:11      //------------------------------------------------------------------
22-Apr-2019 15:38:11 @@ -426,7 +427,7 @@ using namespace casa::vi;
22-Apr-2019 15:38:11      MuellerMatrixType muellerMask_p;
22-Apr-2019 15:38:11      
22-Apr-2019 15:38:11      casacore::Int nPol_p, nChan_p, nW_p, maxXSupport_p, maxYSupport_p;
22-Apr-2019 15:38:11 -    casacore::Vector<casacore::Vector<casacore::Double> >pointingOffset_p;
22-Apr-2019 15:38:11 +    casacore::Vector<casacore::Vector<casacore::Double> > pointingOffset_p;
22-Apr-2019 15:38:11      casacore::Cube<casacore::Int> cfHitsStats;
22-Apr-2019 15:38:11      casacore::Bool freqNdxMapsReady_p;
22-Apr-2019 15:38:11      casacore::Vector<casacore::Vector<casacore::Int> > freqNdxMap_p, conjFreqNdxMap_p;
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/ConvolutionFunction.h b/code/synthesis/TransformMachines2/ConvolutionFunction.h
22-Apr-2019 15:38:11 index 3b9b544..3a92052 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/ConvolutionFunction.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/ConvolutionFunction.h
22-Apr-2019 15:38:11 @@ -144,10 +144,8 @@ namespace casa{
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      //    virtual void setFeedStokes(const casacore::Vector<casacore::Int>& feedStokes) = 0;
22-Apr-2019 15:38:11      virtual casacore::Bool findSupport(casacore::Array<casacore::Complex>& func, casacore::Float& threshold,casacore::Int& origin, casacore::Int& R)=0;
22-Apr-2019 15:38:11 -    /* virtual casacore::Vector<casacore::Double> findPointingOffset(const casacore::ImageInterface<casacore::Complex>& image, */
22-Apr-2019 15:38:11 -    /*                                                                   const VisBuffer2& vb, const casacore::Bool& doPointing) = 0; */
22-Apr-2019 15:38:11 -    virtual casacore::Vector<casacore::Vector<casacore::Double> > findPointingOffset(const casacore::ImageInterface<casacore::Complex>& image,
22-Apr-2019 15:38:11 -                                                                  const VisBuffer2& vb, const casacore::Bool& doPointing) = 0;
22-Apr-2019 15:38:11 +    virtual casacore::Vector<casacore::Double> findPointingOffset(const casacore::ImageInterface<casacore::Complex>& image,
22-Apr-2019 15:38:11 +                                              const VisBuffer2& vb) = 0;
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      // virtual void setParams(const casacore::Vector<casacore::Int>& polMap, const casacore::Vector<casacore::Int>& feedStokes)
22-Apr-2019 15:38:11      // {setPolMap(polMap); setFeedStokes(feedStokes);};
22-Apr-2019 15:38:11 @@ -161,6 +159,12 @@ namespace casa{
22-Apr-2019 15:38:11      virtual void setPointingOffsets(const casacore::CountedPtr<refim::PointingOffsets>& po){po_p=po;};
22-Apr-2019 15:38:11      virtual casacore::CountedPtr<CFTerms> getTerm(const casacore::String& /*name*/) {return NULL;}
22-Apr-2019 15:38:11      virtual int getOversampling(){return 1;};
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11 +    virtual casacore::Vector<casacore::Vector<casacore::Double> > findPointingOffset(const casacore::ImageInterface<casacore::Complex>& image,
22-Apr-2019 15:38:11 +                                                                  const VisBuffer2& vb, const casacore::Bool& doPointing) = 0;
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11    private:
22-Apr-2019 15:38:11      casacore::Int nDim;
22-Apr-2019 15:38:11    protected:
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/IlluminationConvFunc.h b/code/synthesis/TransformMachines2/IlluminationConvFunc.h
22-Apr-2019 15:38:11 index 46db718..63e6e3d 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/IlluminationConvFunc.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/IlluminationConvFunc.h
22-Apr-2019 15:38:11 @@ -99,10 +99,8 @@ namespace casa{
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      casacore::Bool findSupport(casacore::Array<casacore::Complex>&, casacore::Float& ,casacore::Int&, casacore::Int&)
22-Apr-2019 15:38:11      {throw(casacore::AipsError("IlluminationConvFunc::findSupport() not implemented"));};
22-Apr-2019 15:38:11 -    /* virtual casacore::Vector<casacore::Double> findPointingOffset(const casacore::ImageInterface<casacore::Complex>& /\*image*\/, */
22-Apr-2019 15:38:11 -    /*                                                                   const VisBuffer2& /\*vb*\/, const casacore::Bool& /\*doPointing*\/) */
22-Apr-2019 15:38:11 -    virtual casacore::Vector< casacore::Vector<casacore::Double> > findPointingOffset(const casacore::ImageInterface<casacore::Complex>& /*image*/,
22-Apr-2019 15:38:11 -                                                                  const VisBuffer2& /*vb*/, const casacore::Bool& /*doPointing*/)
22-Apr-2019 15:38:11 +    virtual casacore::Vector<casacore::Double> findPointingOffset(const casacore::ImageInterface<casacore::Complex>& /*image*/,
22-Apr-2019 15:38:11 +                                              const VisBuffer2& /*vb*/)
22-Apr-2019 15:38:11      {throw(casacore::AipsError("IlluminationConvFunc::findPointingOffset() not implemented"));};
22-Apr-2019 15:38:11      //virtual void prepareConvFunction(const VisBuffer2& /*vb*/, VBRow2CFBMapType& /*theMap*/)
22-Apr-2019 15:38:11      virtual void prepareConvFunction(const VisBuffer2& /*vb*/, VB2CFBMap& /*theMap*/)
22-Apr-2019 15:38:11 @@ -121,6 +119,10 @@ namespace casa{
22-Apr-2019 15:38:11        {throw(casacore::AipsError("IlluminationConvFunc::makeAverageRes() called"));};
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11                  
22-Apr-2019 15:38:11 +    virtual casacore::Vector< casacore::Vector<casacore::Double> > findPointingOffset(const casacore::ImageInterface<casacore::Complex>& /*image*/,
22-Apr-2019 15:38:11 +                                                                  const VisBuffer2& /*vb*/, const casacore::Bool& /*doPointing*/)
22-Apr-2019 15:38:11 +    {throw(casacore::AipsError("IlluminationConvFunc::findPointingOffset() not implemented"));};
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11    private:
22-Apr-2019 15:38:11      ExpCache<CF_TYPE> ExpTable;
22-Apr-2019 15:38:11      CExp3<CF_TYPE> CExpTable;
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/PhaseGrad.cc b/code/synthesis/TransformMachines2/PhaseGrad.cc
22-Apr-2019 15:38:11 index b9aceda..f188e61 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/PhaseGrad.cc
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/PhaseGrad.cc
22-Apr-2019 15:38:11 @@ -45,16 +45,30 @@ namespace casa{
22-Apr-2019 15:38:11        {
22-Apr-2019 15:38:11         field_phaseGrad_p = other.field_phaseGrad_p;
22-Apr-2019 15:38:11         antenna_phaseGrad_p = other.antenna_phaseGrad_p;
22-Apr-2019 15:38:11 -        // cached_FieldOffset_p[0] = other.cached_FieldOffset_p[0];
22-Apr-2019 15:38:11 -        // cached_FieldOffset_p[1] = other.cached_FieldOffset_p[1];
22-Apr-2019 15:38:11 -        // cached_AntennaOffset_p[0] = other.cached_AntennaOffset_p[0];
22-Apr-2019 15:38:11 -        // cached_AntennaOffset_p[1] = other.cached_AntennaOffset_p[1];
22-Apr-2019 15:38:11 +        cached_FieldOffset_p = other.cached_FieldOffset_p;
22-Apr-2019 15:38:11        }
22-Apr-2019 15:38:11      return *this;
22-Apr-2019 15:38:11    }
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11    //----------------------------------------------------------------------
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11 +  bool PhaseGrad::needsNewPhaseGrad(const Vector<Vector<double> >& pointingOffset,
22-Apr-2019 15:38:11 +                                    const VisBuffer2& vb,
22-Apr-2019 15:38:11 +                                    const int& row)
22-Apr-2019 15:38:11 +  {
22-Apr-2019 15:38:11 +    unsigned int nRow=vb.nRows();
22-Apr-2019 15:38:11 +    if (cached_FieldOffset_p.nelements() < nRow) cached_FieldOffset_p.resize(nRow,true);
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11 +    return (
22-Apr-2019 15:38:11 +            ((fabs(pointingOffset[row][0]-cached_FieldOffset_p[row](0))) > 1e-12) ||
22-Apr-2019 15:38:11 +            ((fabs(pointingOffset[row][1]-cached_FieldOffset_p[row](1))) > 1e-12) ||
22-Apr-2019 15:38:11 +            (field_phaseGrad_p.shape()[0] < maxCFShape_p[0])           ||
22-Apr-2019 15:38:11 +            (field_phaseGrad_p.shape()[1] < maxCFShape_p[1])
22-Apr-2019 15:38:11 +            );
22-Apr-2019 15:38:11 +  }
22-Apr-2019 15:38:11 +  //
22-Apr-2019 15:38:11 +  //----------------------------------------------------------------------
22-Apr-2019 15:38:11 +  //
22-Apr-2019 15:38:11    // bool PhaseGrad::ComputeFieldPointingGrad(const Vector<double>& pointingOffset,
22-Apr-2019 15:38:11    //                                            const CountedPtr<CFBuffer>& cfb,
22-Apr-2019 15:38:11    //                                            const Vector<int>&cfShape,
22-Apr-2019 15:38:11 @@ -64,7 +78,7 @@ namespace casa{
22-Apr-2019 15:38:11    //                                            const int& spwID, const int& fieldId)
22-Apr-2019 15:38:11    bool PhaseGrad::ComputeFieldPointingGrad(const Vector<Vector<double> >& pointingOffset,
22-Apr-2019 15:38:11                                            const CountedPtr<CFBuffer>& cfb,
22-Apr-2019 15:38:11 -                                           const VisBuffer2& ,//vb
22-Apr-2019 15:38:11 +                                           const VisBuffer2& vb,
22-Apr-2019 15:38:11                                            const int& row
22-Apr-2019 15:38:11                                            )
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 @@ -76,30 +90,32 @@ namespace casa{
22-Apr-2019 15:38:11        if (thisCFB != cachedCFBPtr_p)
22-Apr-2019 15:38:11         {
22-Apr-2019 15:38:11           maxCFShape_p[0] = maxCFShape_p[1] = cfb->getMaxCFSize();
22-Apr-2019 15:38:11 -          // {
22-Apr-2019 15:38:11 -          //   // LogIO log_l(LogOrigin("PhaseGrad","computeFieldPointingGrad"));
22-Apr-2019 15:38:11 -          //   cerr << "CFB changed: "<< thisCFB << " " << cachedCFBPtr_p << " " << vb.spectralWindows()(0) << " " << vb.fieldId()(0) << " " << maxCFShape_p << endl;
22-Apr-2019 15:38:11 -          // }
22-Apr-2019 15:38:11 +          {
22-Apr-2019 15:38:11 +            // LogIO log_l(LogOrigin("PhaseGrad","computeFieldPointingGrad"));
22-Apr-2019 15:38:11 +            //cerr << "CFB changed: "<< thisCFB << " " << cachedCFBPtr_p << " " << vb.spectralWindows()(0) << " " << vb.fieldId()(0) << " " << maxCFShape_p << endl;
22-Apr-2019 15:38:11 +          }
22-Apr-2019 15:38:11           cachedCFBPtr_p = thisCFB;
22-Apr-2019 15:38:11         }
22-Apr-2019 15:38:11        //
22-Apr-2019 15:38:11        // If the pointing or the max. CF size changed, recompute the phase gradient.
22-Apr-2019 15:38:11        //
22-Apr-2019 15:38:11 -      if (
22-Apr-2019 15:38:11 -          ((fabs(pointingOffset[row][0]-cached_FieldOffset_p[0])) > 1e-6) ||
22-Apr-2019 15:38:11 -          ((fabs(pointingOffset[row][1]-cached_FieldOffset_p[1])) > 1e-6) ||
22-Apr-2019 15:38:11 -          (field_phaseGrad_p.shape()[0] < maxCFShape_p[0])           ||
22-Apr-2019 15:38:11 -          (field_phaseGrad_p.shape()[1] < maxCFShape_p[1])
22-Apr-2019 15:38:11 -          )
22-Apr-2019 15:38:11 +      if (needsNewPhaseGrad(pointingOffset, vb, row))
22-Apr-2019 15:38:11         {
22-Apr-2019 15:38:11 +          LogIO log_l(LogOrigin("PhaseGrad","computeFieldPointingGrad"));
22-Apr-2019 15:38:11 +          log_l << "Computing Phase Grad: " << row << " " << pointingOffset[row][0] << " " << pointingOffset[row][1] << " " << cached_FieldOffset_p[row](0) << " "
22-Apr-2019 15:38:11 +                << cached_FieldOffset_p[row](1) << " " << field_phaseGrad_p.shape() << " " << maxCFShape_p[0]  << " "
22-Apr-2019 15:38:11 +                << cached_FieldOffset_p.nelements()
22-Apr-2019 15:38:11 +                << LogIO::POST;
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11           int nx=maxCFShape_p(0), ny=maxCFShape_p(1);
22-Apr-2019 15:38:11           double grad;
22-Apr-2019 15:38:11           Complex phx,phy;
22-Apr-2019 15:38:11           Vector<int> convOrigin = maxCFShape_p/2;
22-Apr-2019 15:38:11          
22-Apr-2019 15:38:11           field_phaseGrad_p.resize(nx,ny);
22-Apr-2019 15:38:11 -          cached_FieldOffset_p[0] = pointingOffset[row][0];
22-Apr-2019 15:38:11 -          cached_FieldOffset_p[1] = pointingOffset[row][1];
22-Apr-2019 15:38:11 +          cached_FieldOffset_p[row] = pointingOffset[row];
22-Apr-2019 15:38:11 +          // cached_FieldOffset_p[row](0) = pointingOffset[row][0];
22-Apr-2019 15:38:11 +          // cached_FieldOffset_p[row](1) = pointingOffset[row][1];
22-Apr-2019 15:38:11          
22-Apr-2019 15:38:11           for(int ix=0;ix<nx;ix++)
22-Apr-2019 15:38:11             {
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/PhaseGrad.h b/code/synthesis/TransformMachines2/PhaseGrad.h
22-Apr-2019 15:38:11 index 730f1bb..e2a4eff 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/PhaseGrad.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/PhaseGrad.h
22-Apr-2019 15:38:11 @@ -49,8 +49,8 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11    class PhaseGrad
22-Apr-2019 15:38:11    {
22-Apr-2019 15:38:11    public:
22-Apr-2019 15:38:11 -    PhaseGrad():field_phaseGrad_p(), antenna_phaseGrad_p(), cachedCFBPtr_p(NULL), maxCFShape_p(2,0)
22-Apr-2019 15:38:11 -    {cached_FieldOffset_p[0] = cached_FieldOffset_p[1] = cached_AntennaOffset_p[0] = cached_AntennaOffset_p[1] = 0;}
22-Apr-2019 15:38:11 +    PhaseGrad():field_phaseGrad_p(), antenna_phaseGrad_p(), cached_FieldOffset_p(), cachedCFBPtr_p(NULL), maxCFShape_p(2)
22-Apr-2019 15:38:11 +    {};
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      ~PhaseGrad() {};
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 @@ -58,6 +58,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11      
22-Apr-2019 15:38:11      inline const casacore::Matrix<casacore::Complex>& getFieldPointingGrad() {return field_phaseGrad_p;}
22-Apr-2019 15:38:11      inline const casacore::Matrix<casacore::Complex>& getAntennaPointingGrad() {return antenna_phaseGrad_p;}
22-Apr-2019 15:38:11 +    bool needsNewPhaseGrad(const casacore::Vector<casacore::Vector<double> >& pointingOffset,
22-Apr-2019 15:38:11 +                           const vi::VisBuffer2& vb,
22-Apr-2019 15:38:11 +                           const int& row);
22-Apr-2019 15:38:11      //    void getPhaseGrad(casacore::Matrix<casacore::Complex>& fullPhaseGrad) {fullPhaseGrad = antenna_phaseGrad_p + sky_phaseGrad_p;}
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      bool ComputeFieldPointingGrad(const casacore::Vector<double>& pointingOffset,
22-Apr-2019 15:38:11 @@ -67,7 +70,6 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11                                   const casacore::CountedPtr<CFBuffer>& cfb,
22-Apr-2019 15:38:11                                   const vi::VisBuffer2& vb,
22-Apr-2019 15:38:11                                   const int& row);
22-Apr-2019 15:38:11 -   
22-Apr-2019 15:38:11      // bool ComputeFieldPointingGrad(const casacore::Vector<double>& pointingOffset,
22-Apr-2019 15:38:11      //                                   const casacore::Vector<int>&cfShape,
22-Apr-2019 15:38:11      //                                   const casacore::Vector<int>& convOrigin,
22-Apr-2019 15:38:11 @@ -78,7 +80,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11      //  private:
22-Apr-2019 15:38:11      casacore::Matrix<casacore::Complex> field_phaseGrad_p;
22-Apr-2019 15:38:11      casacore::Matrix<casacore::Complex> antenna_phaseGrad_p;
22-Apr-2019 15:38:11 -    casacore::Double cached_FieldOffset_p[2], cached_AntennaOffset_p[2];
22-Apr-2019 15:38:11 +    casacore::Vector<casacore::RigidVector<double, 2> > cached_FieldOffset_p;
22-Apr-2019 15:38:11      CFBuffer* cachedCFBPtr_p;
22-Apr-2019 15:38:11      casacore::Vector<int> maxCFShape_p;
22-Apr-2019 15:38:11    };
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/PointingOffsets.cc b/code/synthesis/TransformMachines2/PointingOffsets.cc
22-Apr-2019 15:38:11 index 20e019a..1cb00ec 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/PointingOffsets.cc
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/PointingOffsets.cc
22-Apr-2019 15:38:11 @@ -27,14 +27,14 @@
22-Apr-2019 15:38:11 //# $Id$
22-Apr-2019 15:38:11 //
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 -#include <msvis/MSVis/VisBufferUtil.h>
22-Apr-2019 15:38:11 #include <msvis/MSVis/VisibilityIterator2.h>
22-Apr-2019 15:38:11 #include <measures/Measures/MeasTable.h>
22-Apr-2019 15:38:11 #include <ms/MeasurementSets/MSColumns.h>
22-Apr-2019 15:38:11 #include <synthesis/TransformMachines2/PointingOffsets.h>
22-Apr-2019 15:38:11 -#include <casa/Logging/LogIO.h>
22-Apr-2019 15:38:11 -#include <casa/Logging/LogSink.h>
22-Apr-2019 15:38:11 -#include <casa/Logging/LogOrigin.h>
22-Apr-2019 15:38:11 +#include <synthesis/TransformMachines/SynthesisError.h>
22-Apr-2019 15:38:11 +// #include <casa/Logging/LogIO.h>
22-Apr-2019 15:38:11 +// #include <casa/Logging/LogSink.h>
22-Apr-2019 15:38:11 +// #include <casa/Logging/LogOrigin.h>
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 using namespace casacore;
22-Apr-2019 15:38:11 namespace casa{
22-Apr-2019 15:38:11 @@ -49,98 +49,93 @@ namespace casa{
22-Apr-2019 15:38:11        {
22-Apr-2019 15:38:11         imageDC_p = other.imageDC_p;
22-Apr-2019 15:38:11         imageObsInfo_p = other.imageObsInfo_p;
22-Apr-2019 15:38:11 -        doPointing_p = other.doPointing_p;
22-Apr-2019 15:38:11        }
22-Apr-2019 15:38:11      return *this;
22-Apr-2019 15:38:11    }
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11    //----------------------------------------------------------------------
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11 -  casacore::Vector<casacore::Vector<double> >PointingOffsets::findMosaicPointingOffset(const casacore::ImageInterface<casacore::Complex>& image,
22-Apr-2019 15:38:11 -                                                                     const VisBuffer2& vb, const casacore::Bool& doPointing)
22-Apr-2019 15:38:11 +  Vector<Vector<double> >PointingOffsets::findMosaicPointingOffset(const ImageInterface<Complex>& image,
22-Apr-2019 15:38:11 +                                                                   const VisBuffer2& vb, const Bool& doPointing)
22-Apr-2019 15:38:11    {
22-Apr-2019 15:38:11 -    VisBufferUtil vbUtils;
22-Apr-2019 15:38:11 -    //cerr << "#######: Using Mosaic Field pointing offsets" <<endl;
22-Apr-2019 15:38:11      storeImageParams(image,vb);
22-Apr-2019 15:38:11      //where in the image in pixels is this pointing
22-Apr-2019 15:38:11      pixFieldGrad_p.resize(2);
22-Apr-2019 15:38:11      int antId,numRow;
22-Apr-2019 15:38:11      antId = 0;
22-Apr-2019 15:38:11      numRow = 0;
22-Apr-2019 15:38:11 -    casacore::Vector<casacore::Vector<double> >pixFieldGrad_l;
22-Apr-2019 15:38:11 +    Vector<Vector<double> >pixFieldGrad_l;
22-Apr-2019 15:38:11      pixFieldGrad_l.resize(1);
22-Apr-2019 15:38:11 -    MDirection dir = vbUtils.getPointingDir(vb,antId,numRow,doPointing);
22-Apr-2019 15:38:11 -    //cerr << "VBDir: " << dir<< endl;
22-Apr-2019 15:38:11 +    MDirection dir = vbUtils_p.getPointingDir(vb,antId,numRow,dc_p.directionType(),doPointing);
22-Apr-2019 15:38:11      thePix_p = toPix(vb, dir, dir);
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      pixFieldGrad_p = gradPerPixel(thePix_p);
22-Apr-2019 15:38:11 -    //    MDirection fieldDir=direction1_p;
22-Apr-2019 15:38:11 -    //shift from center
22-Apr-2019 15:38:11 -    //pixFieldGrad_p(0) = pixFieldGrad_p(0) - double(nx_p / 2);
22-Apr-2019 15:38:11 -    //pixFieldGrad_p(1) = pixFieldGrad_p(1) - double(ny_p / 2);
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -    //Int convSampling=getOversampling(*psTerm_p,*wTerm_p,*aTerm_p);
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -    //phase gradient per pixel to apply
22-Apr-2019 15:38:11 -    //pixFieldGrad_p(0) = -pixFieldGrad_p(0)*2.0*C::pi/double(nx_p)/double(convOversampling_p);
22-Apr-2019 15:38:11 -    //pixFieldGrad_p(1) = -pixFieldGrad_p(1)*2.0*C::pi/double(ny_p)/double(convOversampling_p);
22-Apr-2019 15:38:11      pixFieldGrad_l(0)=(pixFieldGrad_p);
22-Apr-2019 15:38:11 -    //pixFieldGrad_l(1)=(pixFieldGrad_p);
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11      return pixFieldGrad_l;
22-Apr-2019 15:38:11    };
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11    //----------------------------------------------------------------------
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11 -  casacore::Vector<casacore::Vector<double> > PointingOffsets::findAntennaPointingOffset(const casacore::ImageInterface<casacore::Complex>& image,
22-Apr-2019 15:38:11 -                                                                      const vi::VisBuffer2& vb, const casacore::Bool& doPointing)
22-Apr-2019 15:38:11 +  Vector<Vector<double> > PointingOffsets::findAntennaPointingOffset(const ImageInterface<Complex>& image,
22-Apr-2019 15:38:11 +                                                                     const vi::VisBuffer2& vb, const Bool& doPointing)
22-Apr-2019 15:38:11    {
22-Apr-2019 15:38:11 -    casacore::Vector< casacore::Vector<double> >antOffsets;
22-Apr-2019 15:38:11 +    Vector<Vector<double> >antOffsets;
22-Apr-2019 15:38:11      storeImageParams(image,vb);
22-Apr-2019 15:38:11 -    VisBufferUtil vbUtils;
22-Apr-2019 15:38:11 -    const casacore::Vector<casacore::Int>& antID1 = vb.antenna1();
22-Apr-2019 15:38:11 -    const casacore::Vector<casacore::Int>& antID2 = vb.antenna2();
22-Apr-2019 15:38:11 -    int numRow_p = vb.nRows();
22-Apr-2019 15:38:11 -    antOffsets.resize(numRow_p); // The array is resized to fit for a given vb
22-Apr-2019 15:38:11 -    for (int irow=0; irow<numRow_p;irow++)
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11 +    if (epJ_p.null())
22-Apr-2019 15:38:11        {
22-Apr-2019 15:38:11 -        MDirection antDir1 =vbUtils.getPointingDir(vb, antID1[irow], irow, doPointing);
22-Apr-2019 15:38:11 -        MDirection antDir2 =vbUtils.getPointingDir(vb, antID2[irow], irow, doPointing);
22-Apr-2019 15:38:11 -        
22-Apr-2019 15:38:11 -        MVDirection vbdir=vb.direction1()(0).getValue();        
22-Apr-2019 15:38:11 -        casacore::Vector<double> thePixDir1_l, thePixDir2_l;
22-Apr-2019 15:38:11 -        thePixDir1_l = toPix(vb, antDir1, vbdir);
22-Apr-2019 15:38:11 -        thePixDir2_l = toPix(vb, antDir2, vbdir);
22-Apr-2019 15:38:11 -        thePix_p = (thePixDir1_l + thePixDir2_l)/2.;
22-Apr-2019 15:38:11 -        antOffsets(irow) = gradPerPixel(thePix_p);
22-Apr-2019 15:38:11 -        //cerr<<"Antenna 1:"<<antID1[irow]<<" AntDir1:"<<antDir1<<" AntDir2:"<<antDir2<<endl;
22-Apr-2019 15:38:11 +        int numRow_p = vb.nRows();
22-Apr-2019 15:38:11 +        antOffsets.resize(numRow_p); // The array is resized to fit for a given vb
22-Apr-2019 15:38:11 +        if (PO_DEBUG_P==1)
22-Apr-2019 15:38:11 +          cerr << "-------------------------------------------------------------------------" << endl;
22-Apr-2019 15:38:11 +        for (int irow=0; irow<numRow_p;irow++)
22-Apr-2019 15:38:11 +          {
22-Apr-2019 15:38:11 +            MDirection antDir1 =vbUtils_p.getPointingDir(vb, vb.antenna1()[irow], irow, dc_p.directionType(), doPointing);
22-Apr-2019 15:38:11 +            MDirection antDir2 =vbUtils_p.getPointingDir(vb, vb.antenna2()[irow], irow, dc_p.directionType(), doPointing);
22-Apr-2019 15:38:11 +           
22-Apr-2019 15:38:11 +            //            MVDirection vbdir=vb.direction1()(0).getValue();        
22-Apr-2019 15:38:11 +            casacore::Vector<double> thePixDir1_l, thePixDir2_l;
22-Apr-2019 15:38:11 +            thePixDir1_l = toPix(vb, antDir1, antDir2);
22-Apr-2019 15:38:11 +            thePixDir2_l = toPix(vb, antDir2, antDir1);
22-Apr-2019 15:38:11 +            thePix_p = (thePixDir1_l + thePixDir2_l)/2.;
22-Apr-2019 15:38:11 +            antOffsets(irow) = gradPerPixel(thePix_p);
22-Apr-2019 15:38:11 +            if (PO_DEBUG_P==1)
22-Apr-2019 15:38:11 +              {
22-Apr-2019 15:38:11 +                cerr << irow << " "
22-Apr-2019 15:38:11 +                     << vb.antenna1()[irow] << " " << vb.antenna2()[irow] << " "
22-Apr-2019 15:38:11 +                     << antDir1 << " " << antDir2 << " "
22-Apr-2019 15:38:11 +                     << vb.direction1()(irow) << " " << vb.direction2()(irow) << " "
22-Apr-2019 15:38:11 +                     << toPix(vb, antDir1, antDir2) << " " << toPix(vb, antDir2,antDir1)
22-Apr-2019 15:38:11 +                     << endl;
22-Apr-2019 15:38:11 +                
22-Apr-2019 15:38:11 +              }
22-Apr-2019 15:38:11 +            //cerr << irow << " " << antOffsets[irow]<< endl;
22-Apr-2019 15:38:11 +          }
22-Apr-2019 15:38:11 +        if (PO_DEBUG_P==1)
22-Apr-2019 15:38:11 +          cerr << "=========================================================================" << endl;
22-Apr-2019 15:38:11        }
22-Apr-2019 15:38:11 -    // int antId,numRow;
22-Apr-2019 15:38:11 -    // antId = 0;
22-Apr-2019 15:38:11 -    // numRow = 0;
22-Apr-2019 15:38:11 -   
22-Apr-2019 15:38:11 -    // MDirection antDir =vbUtils.getPointingDir(vb, antId, numRow, doPointing);
22-Apr-2019 15:38:11 -    // //cerr << "AntDir="<<antDir << endl;
22-Apr-2019 15:38:11 -    // thePix_p = toPix(vb, antDir, antDir);
22-Apr-2019 15:38:11 -    // antOffsets = gradPerPixel(thePix_p);
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -    // // if (epJ_p.isNull())
22-Apr-2019 15:38:11 -    {
22-Apr-2019 15:38:11 -      //cerr << "#######: Using POINTING subtable to get antenna pointing offsets" << endl;
22-Apr-2019 15:38:11 -   
22-Apr-2019 15:38:11 -      //        VisBufferUtil vbUtils;
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -      //int vbrow=0;
22-Apr-2019 15:38:11 -      //int nant = vb.subtableColumns().antenna().nrow();
22-Apr-2019 15:38:11 -      //antOffsets.resize(nant);
22-Apr-2019 15:38:11 -      //for (int antid=0;antid<nant; antid++)
22-Apr-2019 15:38:11 -               {
22-Apr-2019 15:38:11 -            //    MVDirection antdir=vbUtils.getPointingDir(vb, antid, vbrow).getValue();
22-Apr-2019 15:38:11 -                 //    MVDirection vbdir=vb.direction1()(0).getValue();
22-Apr-2019 15:38:11 -                 //antOffsets[antid]=antdir.separation(vbdir);
22-Apr-2019 15:38:11 -               }
22-Apr-2019 15:38:11 +    else
22-Apr-2019 15:38:11 +      {
22-Apr-2019 15:38:11 +        throw(SynthesisFTMachineError("PointingOffsets::findAntennaPointingOffset(): Antenna pointing CalTable support not yet implemented"));
22-Apr-2019 15:38:11 +      }
22-Apr-2019 15:38:11 +    return antOffsets;
22-Apr-2019 15:38:11 +  }
22-Apr-2019 15:38:11 +  //
22-Apr-2019 15:38:11 +  //----------------------------------------------------------------------
22-Apr-2019 15:38:11 +  //
22-Apr-2019 15:38:11 +  Vector< Vector<Double> > PointingOffsets::findPointingOffset(const ImageInterface<Complex>& image,
22-Apr-2019 15:38:11 +                                                               const VisBuffer2& vb, const Bool doPointing)
22-Apr-2019 15:38:11 +  {
22-Apr-2019 15:38:11 +    setDoPointing(doPointing);
22-Apr-2019 15:38:11 +    if (!doPointing)
22-Apr-2019 15:38:11 +      {
22-Apr-2019 15:38:11 +        return findMosaicPointingOffset(image,vb,doPointing);
22-Apr-2019 15:38:11 +      }
22-Apr-2019 15:38:11 +    else
22-Apr-2019 15:38:11 +      {
22-Apr-2019 15:38:11 +        return findAntennaPointingOffset(image,vb,doPointing);
22-Apr-2019 15:38:11        }
22-Apr-2019 15:38:11 -    //cerr<<"Antenna offset :"<<antOffsets<<endl;
22-Apr-2019 15:38:11 -      return antOffsets;
22-Apr-2019 15:38:11    }
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11    //----------------------------------------------------------------------
22-Apr-2019 15:38:11 @@ -164,17 +159,11 @@ namespace casa{
22-Apr-2019 15:38:11                                          const MDirection& dir2)
22-Apr-2019 15:38:11    {
22-Apr-2019 15:38:11      thePix_p.resize(2);
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -     //    if(dc_p.directionType() !=  MDirection::castType(vb.direction1()(0).getRef().getType())){
22-Apr-2019 15:38:11      if(dc_p.directionType() !=  MDirection::castType(dir1.getRef().getType()))
22-Apr-2019 15:38:11        {
22-Apr-2019 15:38:11        //pointToPix_p.setModel(theDir);
22-Apr-2019 15:38:11        
22-Apr-2019 15:38:11        MEpoch timenow(Quantity(vb.time()(0), timeUnit_p), timeMType_p);
22-Apr-2019 15:38:11 -      //cout << "Ref " << vb.direction1()(0).getRefString() << " ep "
22-Apr-2019 15:38:11 -      //<< timenow.getRefString() << " time " <<
22-Apr-2019 15:38:11 -      //MVTime(timenow.getValue().getTime()).string(MVTime::YMD) <<
22-Apr-2019 15:38:11 -      //endl;
22-Apr-2019 15:38:11        pointFrame_p.resetEpoch(timenow);
22-Apr-2019 15:38:11        //////////////////////////
22-Apr-2019 15:38:11        //pointToPix holds pointFrame_p by reference...
22-Apr-2019 15:38:11 @@ -182,14 +171,16 @@ namespace casa{
22-Apr-2019 15:38:11        direction1_p=pointToPix_p(dir1);
22-Apr-2019 15:38:11        direction2_p=pointToPix_p(dir2);
22-Apr-2019 15:38:11        dc_p.toPixel(thePix_p, direction1_p);
22-Apr-2019 15:38:11 +      //cerr<<" thePix_P from one: "<<thePix_p<< " " << dir1.getRef().getType()<<endl;
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 -     }
22-Apr-2019 15:38:11 +    }
22-Apr-2019 15:38:11      else
22-Apr-2019 15:38:11        {
22-Apr-2019 15:38:11        direction1_p=dir1;
22-Apr-2019 15:38:11        direction2_p=dir2;
22-Apr-2019 15:38:11        dc_p.toPixel(thePix_p, dir1);
22-Apr-2019 15:38:11 -    }
22-Apr-2019 15:38:11 +      //cerr<<" thePix_P from two: "<<thePix_p<< " " << dir1.getRef().getType()<<endl;
22-Apr-2019 15:38:11 +      }
22-Apr-2019 15:38:11      // Return the internal variable, just to make code more readable
22-Apr-2019 15:38:11      // at the place of the call.
22-Apr-2019 15:38:11      return thePix_p;
22-Apr-2019 15:38:11 @@ -198,25 +189,7 @@ namespace casa{
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11    //----------------------------------------------------------------------
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11 -  Vector< Vector<Double> > PointingOffsets::findPointingOffset(const ImageInterface<Complex>& image,
22-Apr-2019 15:38:11 -                                                   const VisBuffer2& vb, const Bool doPointing)
22-Apr-2019 15:38:11 -  {
22-Apr-2019 15:38:11 -    setDoPointing(doPointing);
22-Apr-2019 15:38:11 -    if (!doPointing)
22-Apr-2019 15:38:11 -      {
22-Apr-2019 15:38:11 -        
22-Apr-2019 15:38:11 -        return findMosaicPointingOffset(image,vb,doPointing);
22-Apr-2019 15:38:11 -        
22-Apr-2019 15:38:11 -                        
22-Apr-2019 15:38:11 -      }
22-Apr-2019 15:38:11 -    else
22-Apr-2019 15:38:11 -      {
22-Apr-2019 15:38:11 -        return findAntennaPointingOffset(image,vb,doPointing);
22-Apr-2019 15:38:11 -        
22-Apr-2019 15:38:11 -      }
22-Apr-2019 15:38:11 -  }
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -  void PointingOffsets::storeImageParams(const casacore::ImageInterface<casacore::Complex>& iimage,
22-Apr-2019 15:38:11 +  void PointingOffsets::storeImageParams(const ImageInterface<Complex>& iimage,
22-Apr-2019 15:38:11                                          const VisBuffer2& vb)
22-Apr-2019 15:38:11    {
22-Apr-2019 15:38:11      //image signature changed...rather simplistic for now
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/PointingOffsets.h b/code/synthesis/TransformMachines2/PointingOffsets.h
22-Apr-2019 15:38:11 index 2cba85d..b68bdd9 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/PointingOffsets.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/PointingOffsets.h
22-Apr-2019 15:38:11 @@ -29,11 +29,13 @@
22-Apr-2019 15:38:11 #ifndef SYNTHESIS_TRANSFORM2_POINTINGOFFSETS_H
22-Apr-2019 15:38:11 #define SYNTHESIS_TRANSFORM2_POINTINGOFFSETS_H
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 +#include <synthesis/MeasurementComponents/SolvableVisCal.h>
22-Apr-2019 15:38:11 +#include <synthesis/TransformMachines2/Utils.h>
22-Apr-2019 15:38:11 #include <coordinates/Coordinates/DirectionCoordinate.h>
22-Apr-2019 15:38:11 #include <images/Images/ImageInterface.h>
22-Apr-2019 15:38:11 +#include <msvis/MSVis/VisBufferUtil.h>
22-Apr-2019 15:38:11 #include <images/Images/TempImage.h>
22-Apr-2019 15:38:11 #include <msvis/MSVis/VisBuffer2.h>
22-Apr-2019 15:38:11 -#include <synthesis/MeasurementComponents/SolvableVisCal.h>
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 class SolvableVisJones;
22-Apr-2019 15:38:11 namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11 @@ -44,7 +46,12 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11    class PointingOffsets
22-Apr-2019 15:38:11    {
22-Apr-2019 15:38:11    public:
22-Apr-2019 15:38:11 -    PointingOffsets(const int& convOversampling):epJ_p(),doPointing_p(false)  {convOversampling_p = convOversampling;}
22-Apr-2019 15:38:11 +    PointingOffsets(const int& convOversampling):epJ_p(), doPointing_p(false),vbUtils_p()
22-Apr-2019 15:38:11 +    {
22-Apr-2019 15:38:11 +      convOversampling_p = convOversampling;
22-Apr-2019 15:38:11 +      PO_DEBUG_P = SynthesisUtils::getenv("PO_DEBUG",0);
22-Apr-2019 15:38:11 +      cerr << "PO_DEBUG = " << PO_DEBUG_P << endl;
22-Apr-2019 15:38:11 +   }
22-Apr-2019 15:38:11      ~PointingOffsets() {};
22-Apr-2019 15:38:11      PointingOffsets& operator=(const PointingOffsets& other);
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 @@ -58,14 +65,13 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11      virtual casacore::Vector<casacore::Vector<casacore::Double> >findPointingOffset(const casacore::ImageInterface<casacore::Complex>& image,
22-Apr-2019 15:38:11                                                                   const vi::VisBuffer2& vb, const casacore::Bool doPointing=false);
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 -    //casacore::Vector<double> findPointingOffset(const casacore::ImageInterface<casacore::Complex>& image,
22-Apr-2019 15:38:11 -    //                                                const vi::VisBuffer2& vb);
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11      casacore::Vector<double> gradPerPixel(const casacore::Vector<double>& p);
22-Apr-2019 15:38:11      casacore::Vector<casacore::Double>& toPix(const vi::VisBuffer2& vb,
22-Apr-2019 15:38:11                                               const casacore::MDirection& dir1, const casacore::MDirection& dir2);
22-Apr-2019 15:38:11      void storeImageParams(const casacore::ImageInterface<casacore::Complex>& iimage, const vi::VisBuffer2& vb);
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11      void setDoPointing(const bool& dop=false) {doPointing_p = dop;}
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11    private:
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      casacore::Vector<double> thePix_p, pixFieldGrad_p;
22-Apr-2019 15:38:11 @@ -82,6 +88,9 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11      casacore::MDirection direction2_p;
22-Apr-2019 15:38:11      casacore::CountedPtr<SolvableVisJones> epJ_p;
22-Apr-2019 15:38:11      bool doPointing_p;
22-Apr-2019 15:38:11 +    VisBufferUtil vbUtils_p;
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11 +    int PO_DEBUG_P;
22-Apr-2019 15:38:11    };
22-Apr-2019 15:38:11    //
22-Apr-2019 15:38:11    //-------------------------------------------------------------------------------------------
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/SimplePBConvFunc.cc b/code/synthesis/TransformMachines2/SimplePBConvFunc.cc
22-Apr-2019 15:38:11 index 3630deb..b475314 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/SimplePBConvFunc.cc
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/SimplePBConvFunc.cc
22-Apr-2019 15:38:11 @@ -80,29 +80,32 @@ SimplePBConvFunc::SimplePBConvFunc(): nchan_p(-1),
22-Apr-2019 15:38:11          npol_p(-1), pointToPix_p(), directionIndex_p(-1), thePix_p(0),
22-Apr-2019 15:38:11          filledFluxScale_p(false),doneMainConv_p(0),
22-Apr-2019 15:38:11                                        
22-Apr-2019 15:38:11 -                                      calcFluxScale_p(true), convFunctionMap_p(-1), actualConvIndex_p(-1), convSize_p(0), convSupport_p(0), pointingPix_p(), usePointingTable_p(False)  {
22-Apr-2019 15:38:11 +                                      calcFluxScale_p(true), convFunctionMap_p(-1), actualConvIndex_p(-1), convSize_p(0), convSupport_p(0), pointingPix_p()  {
22-Apr-2019 15:38:11      //
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      pbClass_p=PBMathInterface::COMMONPB;
22-Apr-2019 15:38:11      ft_p=FFT2D(true);
22-Apr-2019 15:38:11 +    usePointingTable_p=False;
22-Apr-2019 15:38:11 }
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11    SimplePBConvFunc::SimplePBConvFunc(const PBMathInterface::PBClass typeToUse):
22-Apr-2019 15:38:11      nchan_p(-1),npol_p(-1),pointToPix_p(),
22-Apr-2019 15:38:11      directionIndex_p(-1), thePix_p(0), filledFluxScale_p(false),doneMainConv_p(0),
22-Apr-2019 15:38:11 -    calcFluxScale_p(true), convFunctionMap_p(-1), actualConvIndex_p(-1), convSize_p(0), convSupport_p(0), pointingPix_p(), usePointingTable_p(False) {
22-Apr-2019 15:38:11 +    calcFluxScale_p(true), convFunctionMap_p(-1), actualConvIndex_p(-1), convSize_p(0), convSupport_p(0), pointingPix_p() {
22-Apr-2019 15:38:11      //
22-Apr-2019 15:38:11      pbClass_p=typeToUse;
22-Apr-2019 15:38:11      ft_p=FFT2D(true);
22-Apr-2019 15:38:11 +    usePointingTable_p=False;
22-Apr-2019 15:38:11    }
22-Apr-2019 15:38:11    SimplePBConvFunc::SimplePBConvFunc(const RecordInterface& rec, const Bool calcfluxneeded)
22-Apr-2019 15:38:11    : nchan_p(-1),npol_p(-1),pointToPix_p(), directionIndex_p(-1), thePix_p(0), filledFluxScale_p(false),
22-Apr-2019 15:38:11      doneMainConv_p(0),
22-Apr-2019 15:38:11 -    calcFluxScale_p(calcfluxneeded), convFunctionMap_p(-1), actualConvIndex_p(-1), convSize_p(0), convSupport_p(0), pointingPix_p(), usePointingTable_p(False)
22-Apr-2019 15:38:11 +    calcFluxScale_p(calcfluxneeded), convFunctionMap_p(-1), actualConvIndex_p(-1), convSize_p(0), convSupport_p(0), pointingPix_p()
22-Apr-2019 15:38:11    {
22-Apr-2019 15:38:11      String err;
22-Apr-2019 15:38:11      fromRecord(err, rec, calcfluxneeded);
22-Apr-2019 15:38:11      ft_p=FFT2D(true);
22-Apr-2019 15:38:11 +    usePointingTable_p=False;
22-Apr-2019 15:38:11    }
22-Apr-2019 15:38:11    SimplePBConvFunc::~SimplePBConvFunc(){
22-Apr-2019 15:38:11      //
22-Apr-2019 15:38:11 @@ -131,7 +134,8 @@ SimplePBConvFunc::SimplePBConvFunc(): nchan_p(-1),
22-Apr-2019 15:38:11                Int ant1=vb.antenna1()(0);
22-Apr-2019 15:38:11                pos=vb.subtableColumns().antenna().positionMeas()(ant1);
22-Apr-2019 15:38:11        }
22-Apr-2019 15:38:11 -      //cout << "TELESCOPE " << tel << endl;
22-Apr-2019 15:38:11 +      imInfo.setTelescope(tel);
22-Apr-2019 15:38:11 +      csys_p.setObsInfo(imInfo);
22-Apr-2019 15:38:11        //Store this to build epochs via the time access of visbuffer later
22-Apr-2019 15:38:11        timeMType_p=MEpoch::castType(mscol.timeMeas()(0).getRef().getType());
22-Apr-2019 15:38:11        timeUnit_p=Unit(mscol.timeMeas().measDesc().getUnits()(0).getName());
22-Apr-2019 15:38:11 @@ -271,7 +275,7 @@ SimplePBConvFunc::SimplePBConvFunc(): nchan_p(-1),
22-Apr-2019 15:38:11      ant1PointingCache_p.resize(val+1, true);
22-Apr-2019 15:38:11      if(hasValidPointing){
22-Apr-2019 15:38:11        //ant1PointingCache_p[val]=vb.direction1()[0];
22-Apr-2019 15:38:11 -      ant1PointingCache_p[val]=vbUtil_p.getPointingDir(vb, vb.antenna1()(0), 0, usePointingTable_p);
22-Apr-2019 15:38:11 +      ant1PointingCache_p[val]=vbutil_p->getPointingDir(vb, vb.antenna1()(0), 0, dc_p.directionType());
22-Apr-2019 15:38:11      }
22-Apr-2019 15:38:11      else
22-Apr-2019 15:38:11        ant1PointingCache_p[val]=vbutil_p->getPhaseCenter(vb);
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/SimplePBConvFunc.h b/code/synthesis/TransformMachines2/SimplePBConvFunc.h
22-Apr-2019 15:38:11 index 35c463a..3509f5e 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/SimplePBConvFunc.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/SimplePBConvFunc.h
22-Apr-2019 15:38:11 @@ -175,6 +175,7 @@ namespace refim{ //namespace for imaging refactor
22-Apr-2019 15:38:11        casacore::CountedPtr<casacore::TempImage<casacore::Float> > convWeightImage_p;
22-Apr-2019 15:38:11        casacore::String bandName_p;
22-Apr-2019 15:38:11        casacore::CountedPtr<VisBufferUtil> vbutil_p;
22-Apr-2019 15:38:11 +      casacore::Bool usePointingTable_p;
22-Apr-2019 15:38:11      private:
22-Apr-2019 15:38:11        casacore::Bool checkPBOfField(const vi::VisBuffer2& vb);
22-Apr-2019 15:38:11        void addPBToFlux(const vi::VisBuffer2& vb);
22-Apr-2019 15:38:11 @@ -195,8 +196,7 @@ namespace refim{ //namespace for imaging refactor
22-Apr-2019 15:38:11        casacore::Block<casacore::CountedPtr<casacore::Vector<casacore::Int> > > convSizes_p;
22-Apr-2019 15:38:11        casacore::Block <casacore::CountedPtr<casacore::Vector<casacore::Int> > > convSupportBlock_p;
22-Apr-2019 15:38:11        casacore::Matrix<casacore::Bool> pointingPix_p;
22-Apr-2019 15:38:11 -      VisBufferUtil vbUtil_p;
22-Apr-2019 15:38:11 -      casacore::Bool usePointingTable_p;
22-Apr-2019 15:38:11 +     
22-Apr-2019 15:38:11      };
22-Apr-2019 15:38:11    }; //end of refim namespace
22-Apr-2019 15:38:11 };// end of namespace
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/VB2CFBMap.cc b/code/synthesis/TransformMachines2/VB2CFBMap.cc
22-Apr-2019 15:38:11 index 0405782..ee1e3df 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/VB2CFBMap.cc
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/VB2CFBMap.cc
22-Apr-2019 15:38:11 @@ -35,17 +35,20 @@
22-Apr-2019 15:38:11 #include <casa/Arrays/Array.h>
22-Apr-2019 15:38:11 #include <casa/Utilities/CountedPtr.h>
22-Apr-2019 15:38:11 #include <synthesis/TransformMachines2/CFStore2.h>
22-Apr-2019 15:38:11 +#include <synthesis/TransformMachines2/ConvolutionFunction.h>
22-Apr-2019 15:38:11 #include <synthesis/TransformMachines2/CFBuffer.h>
22-Apr-2019 15:38:11 #include <synthesis/TransformMachines2/PhaseGrad.h>
22-Apr-2019 15:38:11 #include <msvis/MSVis/VisBuffer2.h>
22-Apr-2019 15:38:11 #include <synthesis/TransformMachines2/VB2CFBMap.h>
22-Apr-2019 15:38:11 -using namespace casacore;
22-Apr-2019 15:38:11 namespace casa{
22-Apr-2019 15:38:11 -  using namespace vi;
22-Apr-2019 15:38:11 +using namespace vi;
22-Apr-2019 15:38:11    namespace refim{
22-Apr-2019 15:38:11 +  Int mapAntIDToAntType(const casacore::Int& /*ant*/) {return 0;};
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11      VB2CFBMap::VB2CFBMap(): vb2CFBMap_p(), cfPhaseGrad_p(), phaseGradCalculator_p(),doPointing_p(false)
22-Apr-2019 15:38:11      {
22-Apr-2019 15:38:11        phaseGradCalculator_p = new PhaseGrad();
22-Apr-2019 15:38:11 +      newPhaseGradComputed_p = false;
22-Apr-2019 15:38:11      };
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11      VB2CFBMap& VB2CFBMap::operator=(const VB2CFBMap& other)
22-Apr-2019 15:38:11 @@ -54,7 +57,7 @@ namespace casa{
22-Apr-2019 15:38:11         {
22-Apr-2019 15:38:11           phaseGradCalculator_p = other.phaseGradCalculator_p;
22-Apr-2019 15:38:11           cfPhaseGrad_p.assign(other.cfPhaseGrad_p);
22-Apr-2019 15:38:11 -          vb2CFBMap_p.assign(vb2CFBMap_p);
22-Apr-2019 15:38:11 +          vb2CFBMap_p.assign(other.vb2CFBMap_p);
22-Apr-2019 15:38:11           doPointing_p = other.doPointing_p;
22-Apr-2019 15:38:11         }
22-Apr-2019 15:38:11        return *this;
22-Apr-2019 15:38:11 @@ -65,23 +68,22 @@ namespace casa{
22-Apr-2019 15:38:11                                        const vi::VisBuffer2& vb,
22-Apr-2019 15:38:11                                        const int& row)
22-Apr-2019 15:38:11      {
22-Apr-2019 15:38:11 -      //if (phaseGradCalculator_p->ComputeFieldPointingGrad(pointingOffset,cfb,vb))
22-Apr-2019 15:38:11        if (doPointing_p)
22-Apr-2019 15:38:11         {
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11 -          phaseGradCalculator_p->ComputeFieldPointingGrad(pointingOffset,cfb,vb, row);
22-Apr-2019 15:38:11 +          if (phaseGradCalculator_p->needsNewPhaseGrad(pointingOffset, vb, 0))
22-Apr-2019 15:38:11 +            {
22-Apr-2019 15:38:11 +              phaseGradCalculator_p->ComputeFieldPointingGrad(pointingOffset,cfb,vb, 0);
22-Apr-2019 15:38:11 +              newPhaseGradComputed_p=true;
22-Apr-2019 15:38:11 +            }
22-Apr-2019 15:38:11         }
22-Apr-2019 15:38:11        else
22-Apr-2019 15:38:11         {
22-Apr-2019 15:38:11           phaseGradCalculator_p->ComputeFieldPointingGrad(pointingOffset,cfb,vb, 0);
22-Apr-2019 15:38:11         }
22-Apr-2019 15:38:11 -      //cerr<<"doPointing VB2CFBMap::sPGPR: "<<<<endl;
22-Apr-2019 15:38:11 -      //cerr<<"Shape of PointingOffset VB2CFBMap::sPGPR :"<< pointingOffset.shape() << " " << pointingOffset[row].shape() << endl;
22-Apr-2019 15:38:11         {
22-Apr-2019 15:38:11 -          cfPhaseGrad_p(row).assign(phaseGradCalculator_p->getFieldPointingGrad());
22-Apr-2019 15:38:11 +          //cfPhaseGrad_p(row).assign(phaseGradCalculator_p->getFieldPointingGrad());
22-Apr-2019 15:38:11 +          cfPhaseGrad_p(row).reference(phaseGradCalculator_p->field_phaseGrad_p);
22-Apr-2019 15:38:11         }
22-Apr-2019 15:38:11 -        //        visResampler_p->setFieldPhaseGrad(phaseGradCalculator_p.getFieldPointingGrad());
22-Apr-2019 15:38:11 -     
22-Apr-2019 15:38:11      }
22-Apr-2019 15:38:11      
22-Apr-2019 15:38:11      Int VB2CFBMap::makeVBRow2CFBMap(CFStore2& cfs,
22-Apr-2019 15:38:11 @@ -103,6 +105,7 @@ namespace casa{
22-Apr-2019 15:38:11        Quantity pa(getPA(vb),"rad");
22-Apr-2019 15:38:11        //PolOuterProduct outerProduct;
22-Apr-2019 15:38:11        Int statusCode=CFDefs::MEMCACHE;
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11        for (Int irow=0;irow<nRow;irow++)
22-Apr-2019 15:38:11         {
22-Apr-2019 15:38:11           //
22-Apr-2019 15:38:11 @@ -124,7 +127,8 @@ namespace casa{
22-Apr-2019 15:38:11             }
22-Apr-2019 15:38:11           catch (CFNotCached& x)
22-Apr-2019 15:38:11             {
22-Apr-2019 15:38:11 -              LogIO log_l(LogOrigin("VB2CFBMap", "makeVBRow2CFMap"));
22-Apr-2019 15:38:11 +              LogIO log_l(LogOrigin("VB2CFBMap", "makeVBRow2CFBMap[R&D]"));
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11               log_l << "CFs not cached for " << pa.getValue("deg")
22-Apr-2019 15:38:11                     << " deg, dPA = " << dPA.getValue("deg")
22-Apr-2019 15:38:11                     << " Field ID = " << vb.fieldId()(0);
22-Apr-2019 15:38:11 @@ -146,7 +150,13 @@ namespace casa{
22-Apr-2019 15:38:11               vb2CFBMap_p(irow) = cfb_l;
22-Apr-2019 15:38:11             }
22-Apr-2019 15:38:11         }
22-Apr-2019 15:38:11 +      // {
22-Apr-2019 15:38:11 +      //         double n=0;
22-Apr-2019 15:38:11 +      //         for (int i=0;i<cfPhaseGrad_p.nelements();i++)
22-Apr-2019 15:38:11 +      //           n+=cfPhaseGrad_p[i].shape().product()*sizeof(casacore::Complex);
22-Apr-2019 15:38:11 +      //         log_l << "Size of VB2CFBMap::cfPhaseGrad_p = " << n << " bytes" << LogIO::POST;
22-Apr-2019 15:38:11 +      // }
22-Apr-2019 15:38:11        return statusCode;
22-Apr-2019 15:38:11      }
22-Apr-2019 15:38:11 -  }
22-Apr-2019 15:38:11 +}
22-Apr-2019 15:38:11 }
22-Apr-2019 15:38:11 diff --git a/code/synthesis/TransformMachines2/VB2CFBMap.h b/code/synthesis/TransformMachines2/VB2CFBMap.h
22-Apr-2019 15:38:11 index 41cdb06..b3cc139 100644
22-Apr-2019 15:38:11 --- a/code/synthesis/TransformMachines2/VB2CFBMap.h
22-Apr-2019 15:38:11 +++ b/code/synthesis/TransformMachines2/VB2CFBMap.h
22-Apr-2019 15:38:11 @@ -48,7 +48,7 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11     class VB2CFBMap
22-Apr-2019 15:38:11     {
22-Apr-2019 15:38:11     public:
22-Apr-2019 15:38:11 -   VB2CFBMap();
22-Apr-2019 15:38:11 +     VB2CFBMap();
22-Apr-2019 15:38:11      
22-Apr-2019 15:38:11       ~VB2CFBMap() {};
22-Apr-2019 15:38:11      
22-Apr-2019 15:38:11 @@ -64,27 +64,19 @@ namespace casa { //# NAMESPACE CASA - BEGIN
22-Apr-2019 15:38:11                                                   const casacore::Vector<casacore::Int>& dataChan2ImChanMap,
22-Apr-2019 15:38:11                                                   const casacore::Vector<casacore::Int>& dataPol2ImPolMap,
22-Apr-2019 15:38:11                                                   const casacore::Vector<casacore::Vector<casacore::Double>>& pointingOffset);
22-Apr-2019 15:38:11 -     /* virtual casacore::Int makeVBRow2CFBMap(CFStore2& cfs, */
22-Apr-2019 15:38:11 -     /*                                             const VisBuffer2& vb, const casacore::Quantity& dPA, */
22-Apr-2019 15:38:11 -     /*                                             const casacore::Vector<casacore::Int>& dataChan2ImChanMap, */
22-Apr-2019 15:38:11 -     /*                                             const casacore::Vector<casacore::Int>& dataPol2ImPolMap, */
22-Apr-2019 15:38:11 -     /*                                             const casacore::Vector<casacore::Vector<casacore::Double>>& pointingOffset, */
22-Apr-2019 15:38:11 -     /*                                             const casacore::Bool& doPointing); */
22-Apr-2019 15:38:11 -
22-Apr-2019 15:38:11       void setPhaseGradPerRow(const casacore::Vector< casacore::Vector<double> >& pointingOffset,
22-Apr-2019 15:38:11                              const casacore::CountedPtr<CFBuffer>& cfb,
22-Apr-2019 15:38:11                              const vi::VisBuffer2& vb,
22-Apr-2019 15:38:11                              const int& row);
22-Apr-2019 15:38:11       inline casacore::Matrix<casacore::Complex>& getCFPhaseGrad(const int& row)//, const int& ant0, const int& ant1)
22-Apr-2019 15:38:11       {return cfPhaseGrad_p(row);}
22-Apr-2019 15:38:11 -     inline casacore::CountedPtr<CFBuffer>& getCFB(const int& row)//, const int& ant0, const int& ant1)
22-Apr-2019 15:38:11 -     {return vb2CFBMap_p(row);}
22-Apr-2019 15:38:11 -     void setDoPointing(const bool& dop=false) {doPointing_p = dop;}
22-Apr-2019 15:38:11 -   protected:
22-Apr-2019 15:38:11 +     void setDoPointing(const bool& dop=false) {doPointing_p = dop;newPhaseGradComputed_p=false;}
22-Apr-2019 15:38:11 +  //   protected:
22-Apr-2019 15:38:11       casacore::Vector<casacore::CountedPtr<CFBuffer > > vb2CFBMap_p;
22-Apr-2019 15:38:11       casacore::Vector<casacore::Matrix<casacore::Complex> > cfPhaseGrad_p;
22-Apr-2019 15:38:11       casacore::CountedPtr<PhaseGrad> phaseGradCalculator_p;
22-Apr-2019 15:38:11 -     bool doPointing_p;
22-Apr-2019 15:38:11 +     bool doPointing_p, newPhaseGradComputed_p;
22-Apr-2019 15:38:11 +     
22-Apr-2019 15:38:11     };
22-Apr-2019 15:38:11   }
22-Apr-2019 15:38:11 }
22-Apr-2019 15:38:11 diff --git a/gcwrap/python/scripts/imagerhelpers/imager_base.py b/gcwrap/python/scripts/imagerhelpers/imager_base.py
22-Apr-2019 15:38:11 index f9d8def..4139187 100644
22-Apr-2019 15:38:11 --- a/gcwrap/python/scripts/imagerhelpers/imager_base.py
22-Apr-2019 15:38:11 +++ b/gcwrap/python/scripts/imagerhelpers/imager_base.py
22-Apr-2019 15:38:11 @@ -96,7 +96,7 @@ class PySynthesisImager:
22-Apr-2019 15:38:11          exists=False;
22-Apr-2019 15:38:11          if (not (cfCacheName == '')):
22-Apr-2019 15:38:11              exists = (os.path.exists(cfCacheName) and os.path.isdir(cfCacheName));
22-Apr-2019 15:38:11 -#        print "####dopointing",self.allgridpars["0"]["dopointing"];
22-Apr-2019 15:38:11 +
22-Apr-2019 15:38:11          for fld in range(0,self.NF):
22-Apr-2019 15:38:11              #print "self.allimpars=",self.allimpars,"\n"
22-Apr-2019 15:38:11              self.SItool.defineimage( self.allimpars[str(fld)] , self.allgridpars[str(fld)] )
22-Apr-2019 15:38:11 diff --git a/gcwrap/tasks/tclean.xml b/gcwrap/tasks/tclean.xml
22-Apr-2019 15:38:11 index dff905e..e55f2df 100644
22-Apr-2019 15:38:11 --- a/gcwrap/tasks/tclean.xml
22-Apr-2019 15:38:11 +++ b/gcwrap/tasks/tclean.xml
22-Apr-2019 15:38:11 @@ -815,7 +815,6 @@ HPX HEALPix grid.  -->
22-Apr-2019 15:38:11               <value>imagemosaic</value>
22-Apr-2019 15:38:11               <value>awproject</value>
22-Apr-2019 15:38:11               <value>awprojectft</value>
22-Apr-2019 15:38:11 -              <value>awp</value>
22-Apr-2019 15:38:11             </allowed>
22-Apr-2019 15:38:11      </param>
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 @@ -936,7 +935,7 @@ HPX HEALPix grid.  -->
22-Apr-2019 15:38:11 </description>
22-Apr-2019 15:38:11             <value type="bool">False</value>
22-Apr-2019 15:38:11      </param>
22-Apr-2019 15:38:11 -    <param type="bool" name="mosweight" subparam="false">
22-Apr-2019 15:38:11 +    <param type="bool" name="mosweight" subparam="true">
22-Apr-2019 15:38:11             <shortdescription>Indepently weight each field in a mosaic</shortdescription>
22-Apr-2019 15:38:11 <description>When doing Brigg's style weighting (including uniform) to perform the weight density calculation for each field indepedently if True. If False the weight density is calculated from the average uv distribution of all the fields.
22-Apr-2019 15:38:11 </description>
22-Apr-2019 15:38:11 @@ -994,7 +993,7 @@ HPX HEALPix grid.  -->
22-Apr-2019 15:38:11             <value type="bool">True</value>
22-Apr-2019 15:38:11      </param>
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 -    <param type="bool" name="conjbeams" subparam="false">
22-Apr-2019 15:38:11 +    <param type="bool" name="conjbeams" subparam="true">
22-Apr-2019 15:38:11             <shortdescription>Use conjugate frequency for wideband A-terms</shortdescription>
22-Apr-2019 15:38:11 <description>Use conjugate frequency for wideband A-terms
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 @@ -1041,7 +1040,7 @@ HPX HEALPix grid.  -->
22-Apr-2019 15:38:11             <value type="string"></value>
22-Apr-2019 15:38:11      </param>
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 -    <param type="bool" name="dopointing" subparam="false">
22-Apr-2019 15:38:11 +    <param type="bool" name="dopointing" subparam="true">
22-Apr-2019 15:38:11       <shortdescription>The parameter makes the gridder utilize the pointing table phase directions while computing the residual image.</shortdescription>
22-Apr-2019 15:38:11 <description>The dopointing flag informs the gridder that it should utilize the pointing table
22-Apr-2019 15:38:11 to use the correct direction in which the antenna is pointing with respect to the pointing phasecenter. </description>
22-Apr-2019 15:38:11 @@ -2609,6 +2608,7 @@ to use the correct direction in which the antenna is pointing with respect to th
22-Apr-2019 15:38:11          <default param="rotatepastep"><value>360.0</value></default>
22-Apr-2019 15:38:11          <default param="wbawp"><value>False</value></default>
22-Apr-2019 15:38:11          <default param="mosweight"><value>False</value></default>
22-Apr-2019 15:38:11 +<!--         <default param="vptable"><value>""</value></default> -->
22-Apr-2019 15:38:11          <default param="pblimit"><value>0.2</value></default>
22-Apr-2019 15:38:11          <default param="conjbeams"><value>False</value></default>
22-Apr-2019 15:38:11          <default param="mosweight"><value>False</value></default>
22-Apr-2019 15:38:11 @@ -2624,20 +2624,7 @@ to use the correct direction in which the antenna is pointing with respect to th
22-Apr-2019 15:38:11          <default param="rotatepastep"><value>360.0</value></default>
22-Apr-2019 15:38:11          <default param="wbawp"><value>False</value></default>
22-Apr-2019 15:38:11          <default param="mosweight"><value>False</value></default>
22-Apr-2019 15:38:11 -         <default param="pblimit"><value>0.2</value></default>
22-Apr-2019 15:38:11 -         <default param="conjbeams"><value>False</value></default>
22-Apr-2019 15:38:11 -         <default param="dopointing"><value>False</value></default>
22-Apr-2019 15:38:11 -       </equals>
22-Apr-2019 15:38:11 -       <equals type="string" value="awp">
22-Apr-2019 15:38:11 -         <default param="wprojplanes"><value>1</value></default>
22-Apr-2019 15:38:11 -         <default param="normtype"><value>"flatnoise"</value></default>
22-Apr-2019 15:38:11 -         <default param="psterm"><value>False</value></default>
22-Apr-2019 15:38:11 -         <default param="aterm"><value>True</value></default>
22-Apr-2019 15:38:11 -         <default param="cfcache"><value>""</value></default>
22-Apr-2019 15:38:11 -         <default param="computepastep"><value>360.0</value></default>
22-Apr-2019 15:38:11 -         <default param="rotatepastep"><value>360.0</value></default>
22-Apr-2019 15:38:11 -         <default param="wbawp"><value>False</value></default>
22-Apr-2019 15:38:11 -         <default param="mosweight"><value>False</value></default>
22-Apr-2019 15:38:11 +<!--         <default param="vptable"><value>""</value></default> -->
22-Apr-2019 15:38:11          <default param="pblimit"><value>0.2</value></default>
22-Apr-2019 15:38:11          <default param="conjbeams"><value>False</value></default>
22-Apr-2019 15:38:11          <default param="dopointing"><value>False</value></default>
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 Comparison returned: 1
22-Apr-2019 15:38:11 Checkout: git checkout ARD-16
22-Apr-2019 15:38:11 Already on 'ARD-16'
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 [git, tag, -a, 5.5.0-94-test-ARD-16-3, -m 'Automatic tag']
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 Done tagging 5.5.0-94-test-ARD-16-3
22-Apr-2019 15:38:11 Pushing 5.5.0-94-test-ARD-16-3 to origin
22-Apr-2019 15:38:11 To ssh://git@open-bitbucket.nrao.edu:7999/casa/casa.git
22-Apr-2019 15:38:11 * [new tag]         5.5.0-94-test-ARD-16-3 -> 5.5.0-94-test-ARD-16-3
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 Pushed 5.5.0-94-test-ARD-16-3 to origin
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 BUILD SUCCESSFUL
22-Apr-2019 15:38:11
22-Apr-2019 15:38:11 Total time: 9.045 secs
22-Apr-2019 15:38:12 Finished task 'Script' with result: Success
22-Apr-2019 15:38:12 Running post build plugin 'Docker Container Cleanup'
22-Apr-2019 15:38:12 Running post build plugin 'NCover Results Collector'
22-Apr-2019 15:38:12 Running post build plugin 'Clover Results Collector'
22-Apr-2019 15:38:12 Running post build plugin 'npm Cache Cleanup'
22-Apr-2019 15:38:12 Running post build plugin 'Artifact Copier'
22-Apr-2019 15:38:12 Finalising the build...
22-Apr-2019 15:38:12 Stopping timer.
22-Apr-2019 15:38:12 Build ARD-BPT13-TBFP-2 completed.
22-Apr-2019 15:38:12 Running on server: post build plugin 'NCover Results Collector'
22-Apr-2019 15:38:12 Running on server: post build plugin 'Build Hanging Detection Configuration'
22-Apr-2019 15:38:12 Running on server: post build plugin 'Clover Delta Calculator'
22-Apr-2019 15:38:12 Running on server: post build plugin 'Maven Dependencies Postprocessor'
22-Apr-2019 15:38:12 All post build plugins have finished
22-Apr-2019 15:38:12 Generating build results summary...
22-Apr-2019 15:38:12 Saving build results to disk...
22-Apr-2019 15:38:12 Logging substituted variables...
22-Apr-2019 15:38:12 Indexing build results...
22-Apr-2019 15:38:12 Finished building ARD-BPT13-TBFP-2.