From d97562a19f12b844483c36338ed9fb64a74cae99 Mon Sep 17 00:00:00 2001 From: Martin Gels <gels@astron.nl> Date: Fri, 2 Feb 2007 09:15:40 +0000 Subject: [PATCH] BugID: 1005 In function getObservationEpoch() the variable sz must be equal to noRuns. These variables must be a multiple of 16, plus 16. --- .../src/WH_DelayCompensation.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc b/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc index 95503eccdb1..7ee706e0184 100644 --- a/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc +++ b/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc @@ -42,7 +42,6 @@ namespace LOFAR namespace CS1 { - INIT_TRACER_CONTEXT(WH_DelayCompensation, LOFARLOGGER_PACKAGE); //##---------------- Public methods ----------------##// @@ -109,7 +108,6 @@ namespace LOFAR void WH_DelayCompensation::process() { - // Calculate the delays for the epoch after the end of the current time // interval. Put the results in itsDelaysAtBegin and itsDelaysAfterEnd. calculateDelays(); @@ -263,7 +261,7 @@ namespace LOFAR void WH_DelayCompensation::getObservationEpoch(const ParameterSet& ps) { LOG_TRACE_FLOW(AUTO_FUNCTION_NAME); - + // The observation epoch should be given by a start time and a stop // time. Both times must be specified in Modified Julian Date (MJD). Epoch startTime; @@ -276,16 +274,21 @@ namespace LOFAR // by the sample rate in seconds. Divide by 86400 to get it in days. Epoch stepTime = ps.getDouble("Observation.NSubbandSamples") / ps.getDouble("Observation.SampleRate") / 86400; - + LOG_TRACE_VAR("Observation:"); LOG_TRACE_VAR_STR(" startTime = " << startTime); LOG_TRACE_VAR_STR(" stopTime = " << stopTime); LOG_TRACE_VAR_STR(" stepTime = " << stepTime); ASSERTSTR(startTime <= stopTime, startTime << " <= " << stopTime); - + // Reserve space in \a itsObservationEpoch to avoid reallocations uint sz = uint(1 + ceil((stopTime - startTime).mjd() / stepTime.mjd())); + + // Variable sz must be equal to noRuns. sz and noRuns must be a multiple + // of 16, plus 16. + sz = ((sz+15)&~15) + 16; + LOG_TRACE_VAR_STR(sz << " epoch(s)"); itsObservationEpoch.reserve(sz); @@ -372,10 +375,7 @@ namespace LOFAR (result.direction[i] * itsPositionDiffs[j]) / speedOfLight; LOG_TRACE_CALC_STR(" [" << i << "]: " << itsDelaysAfterEnd[i]); } - } - - } // namespace CS1 } // namespace LOFAR -- GitLab