Skip to content

Commit d9eb7ea

Browse files
authored
Dev (#17)
* new example * v=0.4.3 * inserted n_el 16 and 32 save dicts * updated example scripts * new example for converting measurement directorys to csv * first implementation of npz to csv * corrected plot angle * fixed position error of measurement * 0.4.4 * added logo * deleted section * new release of 0.4.2 * added 0.5.0 * linting * appended ScioSpecMeasurementConfig * update examples * linting * flake * Update README.md * updated docstring and resolved import error * linting * deleted old docs * added excitation frequency * Inserted exc_freq to dependent files. * v==0.5.2 * prep for pytest publish * pctr * updated picture * v==0.6.0 * changed logo * Update README.md * v==0.6.1 * Update README.md * angle correction * inserted daytime and temperature * docstring and data format * temperature visualization * linting * new visualization and black linting==23.1.0 * updated black==23.1.0 * pypitest==0.6.1.4 * pypi test == 0.6.1.5 * pypi test == 0.6.1.5 * v==0.6.2 * implemented visualization, not added to init * linting * linting#2 * linting #3 * meshing * inserted citation cff * added citation cff * zenodo doi * inserted absolute valued potential data * Implemented mesh generation * gitignore .vscode * inserted raw string for fixing error. * changed function names and inserted v computation * linting * docstring and function descriptions. * linting * skipping first measured value * changed absolute label at potential matrix * init. mesh for import * first try to use pyvista * pyvisa changes * changed prepare for ml routine * merge dev to 3d * updated function * added file in ignore * modified configurations and added an example for 32 electrodes measurement * modified burst count * deleted prototyping functions. * ignored .vsc settings * updated reqs * fixed npz to csv conversion error * changed names of example measurements * deleted unspecified measurement example. * Adjusting the configurations * Ready for test measurements using 32 electrodes. * Inserted Issue marker in npz_to_csv.npz * working example measurement scripts * updated setup_m * linting and ignore * linting and updates * new example script * pypi test release * new release v==0.6.4 * updated readme * Updated Readme TDB * preperations for Ethernet connection * new pytest version and typos * linting * updated and undo some changes from pytest 0.6.4.7 * release==0.6.4.8 * channel group repeated bug resolved. * Added further information, optimized the .gitignore. * fixed current computation configuration bug. * v0.6.5
1 parent 0e22859 commit d9eb7ea

4 files changed

Lines changed: 51 additions & 16 deletions

File tree

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@ All requirements are provided inside the `requirements.txt`. To install them nav
1111

1212
## Run Example Script
1313

14-
For a single measurement, you can simply run the `example` scripts using the command:
14+
For a single measurement, you can simply run one of the `example` scripts using the command:
1515

16-
python measurement_n_el_16.py
16+
python custom_measurement.py
17+
18+
To fing the right port you can use:
19+
20+
21+
from sciopy import available_serial_ports
22+
available_serial_ports()
1723

1824
This script establishes a serial connection to the ScioSpec device, sends the measurement configuration, and starts a
19-
measurement with a burst count of 10. For a successful measurement, you have to plug in the 16 electrodes to the port "channel 1-16" at the ScioSpec device. For saving the data, set `save = True` and insert a valid `s_path` to the `scio_spec_measurement_config` at the beginning of the script.
25+
measurement. For a successful measurement with 16 electordes, you have to plug in the 16 electrodes to the port "channel 1-16" at the ScioSpec device. For saving the data, set `save = True` and insert a valid `s_path` to the `scio_spec_measurement_config` at the beginning of the script. If you don't change the path the files will be saved to the current directory.
2026

21-
The second provided example script `prep_data_for_ml.py` can be used for the conversion of a finished measurement.
27+
The example script `prep_data_for_ml.py` can be used for the conversion of a finished measurement.
2228
This script creates a new folder with the ending `_prepared` and puts together the potential values and object positions for all measurements. This could be useful for later application of machine learning.
2329

2430
## Explanation of stored files (.npz)
2531

26-
2732
- `potential matrix` (e.g. variable P) is a 16x16 matrix (n_el=16). If you visualize it using `from sciopy import plot_potential_matrix` you can recognize the used excitation pattern or if an electrode is a defect.
2833
- `p_with_exc` is the matrix P with the excitation electrodes
2934
- `p_without_exc` is the matrix P without the excitation electrodes
@@ -35,14 +40,17 @@ This script creates a new folder with the ending `_prepared` and puts together t
3540

3641
## TBD
3742

38-
- [ ] Communication using LAN connection.
39-
- [ ] Measurements using 48, 64 electrodes.
40-
- [ ] Adjacent and opposite injection pattern combination.
43+
- [x] Measurements using up to 64 electrodes.
44+
- [x] Measurements using the USB-HS port (Windows).
45+
- [x] Adjacent and opposite injection pattern combination.
4146
- [x] Measurements using 32 electrodes.
4247
- [x] Parsing measurements of 32 electrodes.
4348
- [x] Adjacent and opposite drive patterns for 32 electrodes.
4449
- [x] Measurement using 16 electrodes in opposite and adjacent injection pattern.
50+
- [ ] Communication using LAN connection.
4551

4652
## Contact
4753

54+
If you have ideas or other advises don't hesitate to contact me!
55+
4856
Email: jacob.thoenes@uni-rostock.de

examples/custom_measurement.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,22 @@
1717
files_offset = 0
1818

1919
sciospec_measurement_setup = ScioSpecMeasurementSetup(
20-
burst_count=1,
21-
total_meas_num=10,
22-
n_el=16,
23-
channel_group=[1],
20+
burst_count=1, # The number of measurements to be performed.
21+
total_meas_num=10, # Repetitions of burst count
22+
n_el=64, # Set 16, 32, 48 or 64 and do not forget to change the channel_group.
23+
channel_group=[
24+
1,
25+
2,
26+
3,
27+
4,
28+
], # Use [1] for n_el=16, [1,2] for n_el=32, [1,2,3] for n_el=48, and [1,2,3,4] for n_el=64
2429
exc_freq=10_000, # 10,000Hz = 10kHz
25-
framerate=5,
30+
framerate=5, # Measurements per second
2631
amplitude=0.01, # 0.01A = 10mA (maximum)
27-
inj_skip=0,
32+
inj_skip=0, # injection electrode skip
2833
gain=1,
2934
adc_range=1, # +/- 1V
30-
notes="None",
35+
notes="None", # add measurement information
3136
configured=False,
3237
)
3338

sciopy/setup_m.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,28 @@ def reshape_full_message_in_bursts(
538538
- delete acknowledgement message: lst.shape=(4480,0) | lst.shape=(89600,)
539539
- split this depending on burst count: split_list.shape=(5, 8960) | split_list.shape=(5, 17920)
540540
"""
541+
542+
def length_correction(array: list) -> list:
543+
"""
544+
Implemented by: Oveys Javanmardtilaki
545+
"""
546+
seq_index = 0
547+
mask = np.ones(len(array), dtype=bool)
548+
seq_to_remove = ["18", "1", "92", "18"]
549+
for i in range(len(array)):
550+
if seq_to_remove[seq_index] in array[i]:
551+
seq_index += 1
552+
if seq_index == len(seq_to_remove):
553+
start = i - len(seq_to_remove) + 1
554+
end = i + 1
555+
mask[start:end] = False
556+
seq_index = 0
557+
else:
558+
seq_index = 0
559+
new_array = array[mask]
560+
return new_array
561+
562+
lst = length_correction(lst)
541563
split_list = []
542564
# delete acknowledgement message
543565
lst = lst[4:]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setuptools.setup(
44
name="sciopy",
5-
version="0.6.4.9",
5+
version="0.6.5.0",
66
author="Jacob Peter Thönes",
77
author_email="jacob.thoenes@uni-rostock.de",
88
description="Python based interface module for communication with the ScioSpec Electrical Impedance Tomography (EIT) device.",

0 commit comments

Comments
 (0)