|
28 | 28 | "import time\n", |
29 | 29 | "from sciopy.sciopy import EIT_16_32_64_128, EitMeasurementSetup, available_serial_ports\n", |
30 | 30 | "from sciopy.sciopy import make_results_folder\n", |
| 31 | + "\n", |
31 | 32 | "# create a 'sciospec' EIT device\n", |
32 | 33 | "n_el = 16\n", |
33 | 34 | "sciospec = EIT_16_32_64_128(n_el)\n", |
|
64 | 65 | " amplitude=0.01,\n", |
65 | 66 | " inj_skip=n_el // 2,\n", |
66 | 67 | " gain=1,\n", |
67 | | - " adc_range=1\n", |
| 68 | + " adc_range=1,\n", |
68 | 69 | ")\n", |
69 | 70 | "sciospec.SetMeasurementSetup(setup)\n", |
70 | 71 | "# look inside the docstring of the function and manual\n", |
|
109 | 110 | "execution_count": null, |
110 | 111 | "source": [ |
111 | 112 | "# 1) With burstcount\n", |
112 | | - "sciospec.update_BurstCount(3) \n", |
113 | | - "data= sciospec.StartStopMeasurement(return_as=\"eitframe\", bSaveData=False, bDeleteData=False,\n", |
114 | | - " sSavePath=savepath, bResultsFolder=False)\n", |
| 113 | + "sciospec.update_BurstCount(3)\n", |
| 114 | + "data = sciospec.StartStopMeasurement(\n", |
| 115 | + " return_as=\"eitframe\",\n", |
| 116 | + " bSaveData=False,\n", |
| 117 | + " bDeleteData=False,\n", |
| 118 | + " sSavePath=savepath,\n", |
| 119 | + " bResultsFolder=False,\n", |
| 120 | + ")\n", |
115 | 121 | "print(data.shape)\n", |
116 | 122 | "\n", |
117 | 123 | "# 2) Continuous measurement\n", |
118 | 124 | "sciospec.update_BurstCount(0)\n", |
119 | | - "data= sciospec.StartStopMeasurement(timeout= 5,return_as=\"eitframe\", bSaveData=False, bDeleteData=False,\n", |
120 | | - " sSavePath=savepath,bResultsFolder=False) # measured for five seconds\n", |
| 125 | + "data = sciospec.StartStopMeasurement(\n", |
| 126 | + " timeout=5,\n", |
| 127 | + " return_as=\"eitframe\",\n", |
| 128 | + " bSaveData=False,\n", |
| 129 | + " bDeleteData=False,\n", |
| 130 | + " sSavePath=savepath,\n", |
| 131 | + " bResultsFolder=False,\n", |
| 132 | + ") # measured for five seconds\n", |
121 | 133 | "print(data.shape)\n", |
122 | 134 | "\n", |
123 | 135 | "\n", |
124 | | - "\n", |
125 | 136 | "# 3) Save data in real time and create an additional folder for storage\n", |
126 | | - "data= sciospec.StartStopMeasurement(timeout= 5,return_as=\"eitframe\", bSaveData=True, bDeleteData=False,\n", |
127 | | - " sSavePath=savepath,bResultsFolder=True) # measured for five seconds\n", |
| 137 | + "data = sciospec.StartStopMeasurement(\n", |
| 138 | + " timeout=5,\n", |
| 139 | + " return_as=\"eitframe\",\n", |
| 140 | + " bSaveData=True,\n", |
| 141 | + " bDeleteData=False,\n", |
| 142 | + " sSavePath=savepath,\n", |
| 143 | + " bResultsFolder=True,\n", |
| 144 | + ") # measured for five seconds\n", |
128 | 145 | "print(data.shape)\n", |
129 | 146 | "\n", |
130 | 147 | "\n", |
131 | | - "\n", |
132 | | - "\n", |
133 | 148 | "# 4) For continuous saving results in the same folder, create a folder before and then pass it along\n", |
134 | | - "sCurrPath= make_results_folder(bCreateResultsFolder=True, bSaveData=True, sSavePath=savepath)\n", |
135 | | - "sciospec.StartStopMeasurement(timeout= 5,return_as=\"eitframe\", bSaveData=True, bDeleteData=True,\n", |
136 | | - " sSavePath=sCurrPath,bResultsFolder=False) # measured for five seconds\n", |
| 149 | + "sCurrPath = make_results_folder(\n", |
| 150 | + " bCreateResultsFolder=True, bSaveData=True, sSavePath=savepath\n", |
| 151 | + ")\n", |
| 152 | + "sciospec.StartStopMeasurement(\n", |
| 153 | + " timeout=5,\n", |
| 154 | + " return_as=\"eitframe\",\n", |
| 155 | + " bSaveData=True,\n", |
| 156 | + " bDeleteData=True,\n", |
| 157 | + " sSavePath=sCurrPath,\n", |
| 158 | + " bResultsFolder=False,\n", |
| 159 | + ") # measured for five seconds\n", |
137 | 160 | "time.sleep(3)\n", |
138 | | - "sciospec.StartStopMeasurement(timeout= 5,return_as=\"eitframe\", bSaveData=True, bDeleteData=True,\n", |
139 | | - " sSavePath=sCurrPath,bResultsFolder=False) # measured for five seconds\n", |
| 161 | + "sciospec.StartStopMeasurement(\n", |
| 162 | + " timeout=5,\n", |
| 163 | + " return_as=\"eitframe\",\n", |
| 164 | + " bSaveData=True,\n", |
| 165 | + " bDeleteData=True,\n", |
| 166 | + " sSavePath=sCurrPath,\n", |
| 167 | + " bResultsFolder=False,\n", |
| 168 | + ") # measured for five seconds\n", |
140 | 169 | "time.sleep(3)\n", |
141 | | - "sciospec.StartStopMeasurement(timeout= 5,return_as=\"eitframe\", bSaveData=True, bDeleteData=True,\n", |
142 | | - " sSavePath=sCurrPath,bResultsFolder=False) # measured for five seconds\n", |
143 | | - "\n", |
| 170 | + "sciospec.StartStopMeasurement(\n", |
| 171 | + " timeout=5,\n", |
| 172 | + " return_as=\"eitframe\",\n", |
| 173 | + " bSaveData=True,\n", |
| 174 | + " bDeleteData=True,\n", |
| 175 | + " sSavePath=sCurrPath,\n", |
| 176 | + " bResultsFolder=False,\n", |
| 177 | + ") # measured for five seconds\n", |
144 | 178 | "\n", |
145 | 179 | "\n", |
146 | 180 | "# Arguments:\n", |
147 | 181 | "# bDeleteData: Data is not returned but if bSaveData=True saved, and is deleted from an internal buffer. For False, data is returned according to return_as\n", |
148 | | - "# bSaveData: if Data should be saved in-time with the measurements. Data is saved at sSavePath, \n" |
| 182 | + "# bSaveData: if Data should be saved in-time with the measurements. Data is saved at sSavePath," |
149 | 183 | ], |
150 | 184 | "id": "143a513757acfe71" |
151 | 185 | }, |
|
169 | 203 | "source": [ |
170 | 204 | "# Standard setting \"singleended\" -> potential measurement\n", |
171 | 205 | "sciospec.GetMeasurementSetup(2)\n", |
172 | | - "sciospec.update_BurstCount(3) \n", |
173 | | - "data= sciospec.StartStopMeasurement(return_as=\"eitframe\", bSaveData=False, bDeleteData=False,\n", |
174 | | - " sSavePath=savepath, bResultsFolder=False)\n", |
175 | | - "data_pot=np.abs(data[2])\n", |
176 | | - "\n" |
| 206 | + "sciospec.update_BurstCount(3)\n", |
| 207 | + "data = sciospec.StartStopMeasurement(\n", |
| 208 | + " return_as=\"eitframe\",\n", |
| 209 | + " bSaveData=False,\n", |
| 210 | + " bDeleteData=False,\n", |
| 211 | + " sSavePath=savepath,\n", |
| 212 | + " bResultsFolder=False,\n", |
| 213 | + ")\n", |
| 214 | + "data_pot = np.abs(data[2])" |
177 | 215 | ], |
178 | 216 | "id": "5db0b9e7255bf10b" |
179 | 217 | }, |
|
193 | 231 | "sciospec.GetMeasurementSetup(2)\n", |
194 | 232 | "# look inside the docstring of the function and manual\n", |
195 | 233 | "\n", |
196 | | - "sciospec.update_BurstCount(3) \n", |
197 | | - "data= sciospec.StartStopMeasurement(return_as=\"eitframe\", bSaveData=False, bDeleteData=False,\n", |
198 | | - " sSavePath=savepath, bResultsFolder=False)\n", |
199 | | - "data_skip4= np.abs(data[2])\n", |
| 234 | + "sciospec.update_BurstCount(3)\n", |
| 235 | + "data = sciospec.StartStopMeasurement(\n", |
| 236 | + " return_as=\"eitframe\",\n", |
| 237 | + " bSaveData=False,\n", |
| 238 | + " bDeleteData=False,\n", |
| 239 | + " sSavePath=savepath,\n", |
| 240 | + " bResultsFolder=False,\n", |
| 241 | + ")\n", |
| 242 | + "data_skip4 = np.abs(data[2])\n", |
200 | 243 | "\n", |
201 | 244 | "\n", |
202 | 245 | "fig, ax = plt.subplots(ncols=2)\n", |
|
215 | 258 | "outputs": [], |
216 | 259 | "execution_count": null, |
217 | 260 | "source": [ |
218 | | - "\n", |
219 | 261 | "# Alternatively,\n", |
220 | 262 | "setup = EitMeasurementSetup(\n", |
221 | 263 | " burst_count=4,\n", |
|
227 | 269 | " gain=1,\n", |
228 | 270 | " adc_range=1,\n", |
229 | 271 | " mea_mode=\"skip2\",\n", |
230 | | - " mea_mode_boundary=\"external\"\n", |
| 272 | + " mea_mode_boundary=\"external\",\n", |
231 | 273 | ")\n", |
232 | | - "sciospec.SetMeasurementSetup(setup)\n", |
233 | | - "\n", |
234 | | - "\n", |
235 | | - "\n" |
| 274 | + "sciospec.SetMeasurementSetup(setup)" |
236 | 275 | ], |
237 | 276 | "id": "a026d514146eb1f0" |
238 | 277 | } |
|
0 commit comments