aboutsummaryrefslogtreecommitdiffstats
path: root/amplitude_ramp.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-08-06 21:27:42 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-08-06 21:27:42 +0200
commit50295706666b574400945506b6e19f44f7e9d4b9 (patch)
treeadcc8faa77286c57807c1766c77bce578557d5f1 /amplitude_ramp.py
parentb8a2469cc5a933196a40a1d129b04a24ef748f4b (diff)
downloadODR-StaticPrecorrection-50295706666b574400945506b6e19f44f7e9d4b9.tar.gz
ODR-StaticPrecorrection-50295706666b574400945506b6e19f44f7e9d4b9.tar.bz2
ODR-StaticPrecorrection-50295706666b574400945506b6e19f44f7e9d4b9.zip
Add option num-meas-skip
Diffstat (limited to 'amplitude_ramp.py')
-rwxr-xr-xamplitude_ramp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/amplitude_ramp.py b/amplitude_ramp.py
index f6d1c5b..a80dbf7 100755
--- a/amplitude_ramp.py
+++ b/amplitude_ramp.py
@@ -188,6 +188,7 @@ class RampGenerator(threading.Thread):
self.in_queue_ = Queue()
self.num_meas = int(options.num_meas)
+ self.num_meas_to_skip = int(options.num_meas_to_skip)
self.ampl_start = float(options.ampl_start)
self.ampl_step = float(options.ampl_step)
self.ampl_stop = float(options.ampl_stop)
@@ -229,6 +230,10 @@ class RampGenerator(threading.Thread):
phase_diff_sum = 0
mag_feedback_sum = 0
+ for measurement_ignore in range(self.num_meas_to_skip):
+ # Receive and ignore three floats on the socket
+ sock.recv(12)
+
for measurement_ix in range(self.num_meas):
# Receive three floats on the socket
mag_gen, phase_diff, mag_feedback = struct.unpack(
@@ -280,6 +285,11 @@ parser.add_argument('--num-meas',
help='number of measurements per amplitude',
required=False)
+parser.add_argument('--num-meas-to-skip',
+ default='50',
+ help='After each amplitude change, ignore num-meas-to-skip measurements',
+ required=False)
+
cli_args = parser.parse_args()
rampgen = RampGenerator(cli_args)