|
6 | 6 |
|
7 | 7 |
|
8 | 8 | 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 |
10 | 10 | runinfo.sparse_points[self.runinfo.indicies] = 1, allowing the experiment |
11 | 11 | to skip taking data points. Inherits from :class:`pyscan.measurement.abstract_experiment.AbstractExperiment`. |
12 | 12 |
|
13 | 13 | Parameters |
14 | 14 | ---------- |
15 | 15 | 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 |
17 | 17 | that you want to average should be an instance of |
18 | 18 | :class:`AverageScan<pyscan.measurement.scans.AverageScan>`. |
19 | 19 | 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 |
21 | 21 | :class:`PropertyScan<pyscan.measurement.scans.PropertyScan>`. |
22 | 22 | devices : |
23 | 23 | ItemAttribute instance containing all experiment devices |
@@ -47,29 +47,29 @@ def run(self): |
47 | 47 |
|
48 | 48 | self.runinfo.running = True |
49 | 49 |
|
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) |
55 | 55 |
|
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) |
60 | 60 |
|
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) |
65 | 65 |
|
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 |
68 | 68 | sample = self.runinfo.sparse_points[self.runinfo.indicies] |
69 | 69 |
|
70 | 70 | 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) |
73 | 73 |
|
74 | 74 | data = self.runinfo.measure_function(self) |
75 | 75 | if np.all(np.array(self.runinfo.indicies) == 0): |
@@ -100,7 +100,7 @@ def run(self): |
100 | 100 | break |
101 | 101 |
|
102 | 102 | 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)) |
104 | 104 | if self.runinfo.running is False: |
105 | 105 | self.runinfo.complete = 'stopped' |
106 | 106 | break |
|
0 commit comments