From 0d7117f4548c143dbbf902c3c2e55ca87c6b33f2 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Wed, 17 Apr 2013 12:09:59 +0000
Subject: [PATCH] Task #4365: Support disabling of delay compensation

---
 RTCP/Cobalt/InputProc/src/Delays/Delays.cc | 23 ++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/RTCP/Cobalt/InputProc/src/Delays/Delays.cc b/RTCP/Cobalt/InputProc/src/Delays/Delays.cc
index 856372e7952..32db9a888db 100644
--- a/RTCP/Cobalt/InputProc/src/Delays/Delays.cc
+++ b/RTCP/Cobalt/InputProc/src/Delays/Delays.cc
@@ -191,14 +191,21 @@ namespace LOFAR
     struct Delays::Delay Delays::convert( casa::MDirection::Convert &converter, const casa::MVDirection &direction ) const {
       struct Delay d;
 
-      MVDirection casaDir = converter(direction).getValue();
-
-      // Compute direction and convert it 
-      casa::Vector<double> dir = casaDir.getValue();
-      std::copy(dir.begin(), dir.end(), d.direction);
-
-      // Compute delay
-      d.delay = casaDir * phasePositionDiff * (1.0 / speedOfLight);
+      if (parset.settings.delayCompensation.enabled) {
+        MVDirection casaDir = converter(direction).getValue();
+
+        // Compute direction and convert it 
+        casa::Vector<double> dir = casaDir.getValue();
+        std::copy(dir.begin(), dir.end(), d.direction);
+
+        // Compute delay
+        d.delay = casaDir * phasePositionDiff * (1.0 / speedOfLight);
+      } else {
+        d.delay = 0.0;
+        d.direction[0] = 0.0;
+        d.direction[1] = 0.0;
+        d.direction[2] = 0.0;
+      }
 
       // Add non-geometric delays
       d.delay += baseDelay();
-- 
GitLab