diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h index 396b4c45cecbbf76e4a67f4b7c4718982b61aab8..4776a8a98752128d6b9bd91781a91f9ae93aeb1a 100644 --- a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h +++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h @@ -95,8 +95,8 @@ namespace LOFAR { private: - // Initialize the parmdb - void initH5Parm(); + // Initialize solutions + void initializeSolutions(); //# Data members. DPInput* itsInput; @@ -122,6 +122,7 @@ namespace LOFAR { H5Parm itsH5Parm; string itsMode; + bool itsPropagateSolutions; uint itsTimeStep; uint itsSolInt; uint itsStepInSolInt; diff --git a/CEP/DP3/DPPP_DDECal/src/DDECal.cc b/CEP/DP3/DPPP_DDECal/src/DDECal.cc index 2d9540fe84180bc94478be2d1481b6e991b2592e..7f2af7795116cda7dec4aba67457c914cf0e5cba 100644 --- a/CEP/DP3/DPPP_DDECal/src/DDECal.cc +++ b/CEP/DP3/DPPP_DDECal/src/DDECal.cc @@ -75,6 +75,8 @@ namespace LOFAR { parset.getString("msin")+ "/instrument.h5")), itsH5Parm (itsH5ParmName), + itsPropagateSolutions (parset.getBool (prefix + "propagatesolutions", + false)), itsTimeStep (0), itsSolInt (parset.getInt (prefix + "solint", 1)), itsStepInSolInt (0), @@ -315,6 +317,19 @@ namespace LOFAR { os<<itsNIter[itsNIter.size()-1]<<"]"<<endl; } + void DDECal::initializeSolutions() { + if (itsTimeStep/itsSolInt>0 && itsPropagateSolutions) { + // initialize solutions with those of the previous step + itsSols[itsTimeStep/itsSolInt] = itsSols[itsTimeStep/itsSolInt-1]; + } else { + // initialize solutions with 1. + for (vector<vector<DComplex> >::iterator solveciter = itsSols[itsTimeStep/itsSolInt].begin(); + solveciter != itsSols[itsTimeStep/itsSolInt].end(); ++solveciter) { + (*solveciter).assign(itsDirections.size()*info().antennaNames().size(), 1.0); + } + } + } + bool DDECal::process (const DPBuffer& bufin) { itsTimer.start(); @@ -366,16 +381,8 @@ namespace LOFAR { itsAvgTime += itsAvgTime + bufin.getTime(); if (itsStepInSolInt==itsSolInt-1) { - if (itsTimeStep/itsSolInt>0) { - // initialize solutions with those of the previous step - itsSols[itsTimeStep/itsSolInt] = itsSols[itsTimeStep/itsSolInt-1]; - } else { - // initialize solutions with 1. - for (vector<vector<DComplex> >::iterator solveciter = itsSols[itsTimeStep/itsSolInt].begin(); - solveciter != itsSols[itsTimeStep/itsSolInt].end(); ++solveciter) { - (*solveciter).assign(itsDirections.size()*info().antennaNames().size(), 1.0); - } - } + initializeSolutions(); + itsTimerSolve.start(); MultiDirSolver::SolveResult solveResult = itsMultiDirSolver.process(itsDataPtrs, itsModelDataPtrs, @@ -565,8 +572,8 @@ namespace LOFAR { itsTimer.start(); if (itsStepInSolInt!=0) { - // initialize solutions with those of the previous step - itsSols[itsTimeStep/itsSolInt] = itsSols[itsTimeStep/itsSolInt-1]; + initializeSolutions(); + //shrink itsDataPtrs, itsModelDataPtrs std::vector<casacore::Complex*>(itsDataPtrs.begin(), itsDataPtrs.begin()+itsStepInSolInt).swap(itsDataPtrs);