From be3f3ede06f3428dcebbbc8b5c620fc5ec3b78cb Mon Sep 17 00:00:00 2001
From: wierenga <sdos@astron.nl>
Date: Wed, 8 Nov 2006 14:03:40 +0000
Subject: [PATCH] BugID: 781 Some test scripts to test beamformer en
 correlator.

---
 MAC/APL/PIC/RSPDriver/test/Makefile.am |  4 ++++
 MAC/APL/PIC/RSPDriver/test/beamtest    | 19 +++++++++++++++++++
 MAC/APL/PIC/RSPDriver/test/wgtest      | 12 ++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100755 MAC/APL/PIC/RSPDriver/test/beamtest
 create mode 100755 MAC/APL/PIC/RSPDriver/test/wgtest

diff --git a/MAC/APL/PIC/RSPDriver/test/Makefile.am b/MAC/APL/PIC/RSPDriver/test/Makefile.am
index 6bdc033d174..af44bbdc961 100644
--- a/MAC/APL/PIC/RSPDriver/test/Makefile.am
+++ b/MAC/APL/PIC/RSPDriver/test/Makefile.am
@@ -11,6 +11,10 @@ bin_PROGRAMS = \
 	EPAStub \
 	RSPTest
 
+bin_SCRIPTS = \
+	beamtest \
+	wgtest
+
 #check_PROGRAMS = \
 #	RSPTest
 
diff --git a/MAC/APL/PIC/RSPDriver/test/beamtest b/MAC/APL/PIC/RSPDriver/test/beamtest
new file mode 100755
index 00000000000..0c47dcc9df6
--- /dev/null
+++ b/MAC/APL/PIC/RSPDriver/test/beamtest
@@ -0,0 +1,19 @@
+#!/bin/sh
+killall beamctl
+sleep 10
+declare mpos
+declare blidx
+declare blidx2
+declare -i N=216
+for ((idx = 0; idx < $N; idx++)) do
+    echo $idx
+    mpos=$(eval "echo \"($idx / $N)\" | bc -l")
+    blidx=$(eval "echo \"$idx\" | bc")
+    blidx2=$(eval "echo \"$blidx+8\" | bc")
+    echo $blidx
+    eval "/opt/lofar_beam/bin/beamctl --array=CS1-TEST --rcumode=3 --rcus=0:95 --subbands=256 --beamlets=$blidx --direction=$mpos,0,LOFAR_LMN &"
+#    echo "recording snapshot $idx"
+#    ./rspctl --statistics=beamlet --select=0,1 --integration=1 --duration=1 --directory=/home/lofartest/sjw/beamexperiment
+#   killall beamctl
+done
+
diff --git a/MAC/APL/PIC/RSPDriver/test/wgtest b/MAC/APL/PIC/RSPDriver/test/wgtest
new file mode 100755
index 00000000000..134ebe2267c
--- /dev/null
+++ b/MAC/APL/PIC/RSPDriver/test/wgtest
@@ -0,0 +1,12 @@
+#!/bin/sh
+declare phaserad
+declare startidx
+declare stopidx
+declare -i nrcus=16
+for ((idx = 0; idx < $nrcus; idx++)) do
+    phaserad=$(eval "echo \"($idx * 2 * 3.141592654) / $nrcus\" | bc -l")
+    ampl=$(eval "echo \"$idx/$nrcus\" | bc -l")
+#    eval "rspctl --wg=50e6 --select=$idx --ampli=$ampl --phase=$phaserad"
+    eval "rspctl --wg=50e6 --select=$idx --phase=$phaserad"
+done
+
-- 
GitLab