From 0c87fd2f1f8ed8255ed74c5d0baaf2ed3d4996da Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Mon, 19 Mar 2012 21:27:29 +0000
Subject: [PATCH] Task #2669: Don't redirect stations in R00R01. Cleanup of
 list of fake stations.

---
 RTCP/Run/src/LOFAR/Core.py     | 2 +-
 RTCP/Run/src/LOFAR/Stations.py | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/RTCP/Run/src/LOFAR/Core.py b/RTCP/Run/src/LOFAR/Core.py
index 9cd16576065..38ee7c39321 100644
--- a/RTCP/Run/src/LOFAR/Core.py
+++ b/RTCP/Run/src/LOFAR/Core.py
@@ -43,7 +43,7 @@ def buildParset( parset = None, args = "", olapparset = "OLAP.parset", partition
   assert "run" not in defaultObsParams
 
   # always assume the stations will be sending to the rack we will be using
-  if partition:
+  if partition and partition != "R00R01":
     overrideRack( Stations, int(partition[2]) )
 
   # ========== Observations
diff --git a/RTCP/Run/src/LOFAR/Stations.py b/RTCP/Run/src/LOFAR/Stations.py
index cd4dc947c06..f2be59837d9 100755
--- a/RTCP/Run/src/LOFAR/Stations.py
+++ b/RTCP/Run/src/LOFAR/Stations.py
@@ -20,7 +20,8 @@ def overrideRack( stations, rack ):
   for s in stations:
     for t in stations[s]:
       octets = t.ionode.split(".")
-      t.ionode = "%s.%s.%s.%s" % (octets[0],octets[1],rack,octets[3])
+      if octets[0] == "10" and octets[1] == "170": # only process stations connected to BG/P
+        t.ionode = "%s.%s.%s.%s" % (octets[0],octets[1],rack,octets[3])
 
 def packetAnalysis( name, ip, port ):
   location = os.popen("which packetanalysis").read().strip()
@@ -278,9 +279,6 @@ def defineStations( s ):
 
   # Special stations, one-time stations, etc.
   s.update( {
-   "Pulsar": [Station('Pulsar', '10.170.0.30', ['0.0.0.0:4346'])],
-   "twoears":  [Station('CS302HBA0', '10.170.0.133', ['0.0.0.0:4346']),
-                Station('CS302HBA1', '10.170.0.134', ['0.0.0.0:4347'])],
   } )
 
   # Standard configurations
@@ -337,7 +335,8 @@ if __name__ == "__main__":
     parser.print_help()
     sys.exit(0)
 
-  overrideRack( Stations, int(options.partition[2]) )
+  if options.partition != "R00R01":
+    overrideRack( Stations, int(options.partition[2]) )
 
   for stationName in args:
     # print the inputs of a single station
-- 
GitLab