From b879ae9e48896f41dc732ed9dc87e40f10f28bde Mon Sep 17 00:00:00 2001
From: John Romein <romein@astron.nl>
Date: Tue, 14 Nov 2006 14:55:51 +0000
Subject: [PATCH] BugID: 225 Use center frequencies instead of base frequencies

---
 .../CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc | 16 ++++++++++++----
 Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.h |  2 +-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc b/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc
index 9e6fb4b305b..fe82b2fdc68 100644
--- a/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc
+++ b/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc
@@ -53,7 +53,7 @@ inline static dcomplex cosisin(double x)
 
 #endif
 
-vector<double> WH_BGL_Processing::itsBaseFrequencies;
+vector<double> WH_BGL_Processing::itsCenterFrequencies;
 FIR WH_BGL_Processing::itsFIRs[NR_STATIONS][NR_POLARIZATIONS][NR_SUBBAND_CHANNELS] CACHE_ALIGNED;
 fcomplex WH_BGL_Processing::samples[NR_SUBBAND_CHANNELS][NR_STATIONS][NR_SAMPLES_PER_INTEGRATION | 2][NR_POLARIZATIONS] CACHE_ALIGNED;
 #if defined SPARSE_FLAGS
@@ -1167,8 +1167,8 @@ WH_BGL_Processing::WH_BGL_Processing(const string& name, unsigned coreNumber, co
   ASSERT(_correlator_constants_used.nr_polarizations		== NR_POLARIZATIONS);
 #endif
 
-  if (itsBaseFrequencies.size() == 0)
-    itsBaseFrequencies = ps.getDoubleVector("Observation.RefFreqs");
+  if (itsCenterFrequencies.size() == 0)
+    itsCenterFrequencies = ps.getDoubleVector("Observation.RefFreqs");
 
   itsChannelBandwidth = ps.getDouble("Observation.SampleRate") / NR_SUBBAND_CHANNELS;
 
@@ -1796,7 +1796,7 @@ void WH_BGL_Processing::process()
   computeFlags();
 
 #if NR_SUBBAND_CHANNELS > 1
-  doPPF(itsBaseFrequencies[itsCurrentSubband] - (NR_SUBBAND_CHANNELS / 2) * itsChannelBandwidth);
+  doPPF(itsCenterFrequencies[itsCurrentSubband] - (NR_SUBBAND_CHANNELS / 2) * itsChannelBandwidth);
 #else
   bypassPPF();
 #endif
@@ -1821,6 +1821,14 @@ void WH_BGL_Processing::process()
   std::clog << "core " << TH_MPI::getCurrentRank() << ": start idling at " << MPI_Wtime() << '\n';
 #endif
 
+#if 0
+  static int count = 0;
+
+  if (TH_MPI::getCurrentRank() == 5 && ++ count == 9)
+    for (double time = MPI_Wtime() + 4.0; MPI_Wtime() < time;)
+      ;
+#endif
+
   totalTimer.stop();
 }
 
diff --git a/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.h b/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.h
index 13b26476424..cf919eed5f9 100644
--- a/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.h
+++ b/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.h
@@ -133,7 +133,7 @@ class WH_BGL_Processing: public WorkHolder {
     fftw_plan	    itsFFTWPlan;
 #endif
 
-    static vector<double>  itsBaseFrequencies;
+    static vector<double>  itsCenterFrequencies;
     double	    itsChannelBandwidth;
 
     const ACC::APS::ParameterSet &itsPS;
-- 
GitLab