Skip to content

Commit 423ce39

Browse files
rsbrosti-am-mounce
authored andcommitted
fix(measurement): fixed sparse experiment to use scan naming convention rather than loop.
1 parent af27aa6 commit 423ce39

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

pyscan/measurement/sparse_experiment.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77

88
class SparseExperiment(AbstractExperiment):
9-
'''Experiment class that takes data after each loop0 iteration if
9+
'''Experiment class that takes data after each scan0 iteration if
1010
runinfo.sparse_points[self.runinfo.indicies] = 1, allowing the experiment
1111
to skip taking data points. Inherits from :class:`pyscan.measurement.abstract_experiment.AbstractExperiment`.
1212
1313
Parameters
1414
----------
1515
runinfo: :class:`pyscan.measurement.runinfo.Runinfo`
16-
Runinfo instance. The Runinfo loop containing the dependent variable
16+
Runinfo instance. The Runinfo scan containing the dependent variable
1717
that you want to average should be an instance of
1818
:class:`AverageScan<pyscan.measurement.scans.AverageScan>`.
1919
There should be only one dependent variable to be averaged.
20-
The loops representing independent variables can be instances of
20+
The scans representing independent variables can be instances of
2121
:class:`PropertyScan<pyscan.measurement.scans.PropertyScan>`.
2222
devices :
2323
ItemAttribute instance containing all experiment devices
@@ -47,29 +47,29 @@ def run(self):
4747

4848
self.runinfo.running = True
4949

50-
# Use for loop, but break if self.runinfo.running=False
51-
for m in range(self.runinfo.loop3.n):
52-
self.runinfo.loop3.i = m
53-
self.runinfo.loop3.iterate(m, self.devices)
54-
sleep(self.runinfo.loop3.dt)
50+
# Use for scan, but break if self.runinfo.running=False
51+
for m in range(self.runinfo.scan3.n):
52+
self.runinfo.scan3.i = m
53+
self.runinfo.scan3.iterate(m, self.devices)
54+
sleep(self.runinfo.scan3.dt)
5555

56-
for k in range(self.runinfo.loop2.n):
57-
self.runinfo.loop2.i = k
58-
self.runinfo.loop2.iterate(k, self.devices)
59-
sleep(self.runinfo.loop2.dt)
56+
for k in range(self.runinfo.scan2.n):
57+
self.runinfo.scan2.i = k
58+
self.runinfo.scan2.iterate(k, self.devices)
59+
sleep(self.runinfo.scan2.dt)
6060

61-
for j in range(self.runinfo.loop1.n):
62-
self.runinfo.loop1.i = j
63-
self.runinfo.loop1.iterate(j, self.devices)
64-
sleep(self.runinfo.loop1.dt)
61+
for j in range(self.runinfo.scan1.n):
62+
self.runinfo.scan1.i = j
63+
self.runinfo.scan1.iterate(j, self.devices)
64+
sleep(self.runinfo.scan1.dt)
6565

66-
for i in range(self.runinfo.loop0.n):
67-
self.runinfo.loop0.i = i
66+
for i in range(self.runinfo.scan0.n):
67+
self.runinfo.scan0.i = i
6868
sample = self.runinfo.sparse_points[self.runinfo.indicies]
6969

7070
if (sample) or (np.all(np.array(self.runinfo.indicies) == 0)):
71-
self.runinfo.loop0.iterate(i, self.devices)
72-
sleep(self.runinfo.loop0.dt)
71+
self.runinfo.scan0.iterate(i, self.devices)
72+
sleep(self.runinfo.scan0.dt)
7373

7474
data = self.runinfo.measure_function(self)
7575
if np.all(np.array(self.runinfo.indicies) == 0):
@@ -100,7 +100,7 @@ def run(self):
100100
break
101101

102102
if self.runinfo.verbose:
103-
print('Scan {}/{} Complete'.format(m + 1, self.runinfo.loop3.n))
103+
print('Scan {}/{} Complete'.format(m + 1, self.runinfo.scan3.n))
104104
if self.runinfo.running is False:
105105
self.runinfo.complete = 'stopped'
106106
break

0 commit comments

Comments
 (0)