pyisomme 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyisomme-0.0.0/LICENSE +21 -0
- pyisomme-0.0.0/PKG-INFO +105 -0
- pyisomme-0.0.0/README.md +58 -0
- pyisomme-0.0.0/pyisomme/__init__.py +9 -0
- pyisomme-0.0.0/pyisomme/__main__.py +240 -0
- pyisomme-0.0.0/pyisomme/calculate.py +1012 -0
- pyisomme-0.0.0/pyisomme/channel.py +585 -0
- pyisomme-0.0.0/pyisomme/code.py +161 -0
- pyisomme-0.0.0/pyisomme/correlation.py +28 -0
- pyisomme-0.0.0/pyisomme/info.py +67 -0
- pyisomme-0.0.0/pyisomme/isomme.py +1307 -0
- pyisomme-0.0.0/pyisomme/limits.py +283 -0
- pyisomme-0.0.0/pyisomme/parsing.py +169 -0
- pyisomme-0.0.0/pyisomme/plotting.py +426 -0
- pyisomme-0.0.0/pyisomme/report/__init__.py +2 -0
- pyisomme-0.0.0/pyisomme/report/criterion.py +72 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/__init__.py +7 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/euro_ncap.py +38 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/frontal_50kmh.py +1472 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/frontal_mpdb.py +1280 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/limits.py +39 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/side_barrier.py +216 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/side_farside.py +565 -0
- pyisomme-0.0.0/pyisomme/report/euro_ncap/side_pole.py +475 -0
- pyisomme-0.0.0/pyisomme/report/iihs/limits.py +22 -0
- pyisomme-0.0.0/pyisomme/report/page.py +362 -0
- pyisomme-0.0.0/pyisomme/report/report.py +100 -0
- pyisomme-0.0.0/pyisomme/report/un/__init__.py +4 -0
- pyisomme-0.0.0/pyisomme/report/un/frontal_50kmh_r137.py +494 -0
- pyisomme-0.0.0/pyisomme/report/un/frontal_56kmh_odb_r94.py +569 -0
- pyisomme-0.0.0/pyisomme/report/un/limits.py +13 -0
- pyisomme-0.0.0/pyisomme/report/un/side_barrier_r95.py +232 -0
- pyisomme-0.0.0/pyisomme/report/un/side_pole_r135.py +288 -0
- pyisomme-0.0.0/pyisomme/unit.py +17 -0
- pyisomme-0.0.0/pyisomme/utils.py +27 -0
- pyisomme-0.0.0/pyisomme.egg-info/PKG-INFO +105 -0
- pyisomme-0.0.0/pyisomme.egg-info/SOURCES.txt +42 -0
- pyisomme-0.0.0/pyisomme.egg-info/dependency_links.txt +1 -0
- pyisomme-0.0.0/pyisomme.egg-info/entry_points.txt +2 -0
- pyisomme-0.0.0/pyisomme.egg-info/requires.txt +12 -0
- pyisomme-0.0.0/pyisomme.egg-info/top_level.txt +1 -0
- pyisomme-0.0.0/pyproject.toml +43 -0
- pyisomme-0.0.0/setup.cfg +4 -0
- pyisomme-0.0.0/tests/test.py +410 -0
pyisomme-0.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Jonas Keller
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pyisomme-0.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyisomme
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: Tools for ISO-MME file format (merge, report, calculate, CFC-filter, ...)
|
|
5
|
+
Author-email: Jonas Keller <jonaskeller14@googlemail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024 Jonas Keller
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/jonaskeller14/pyisomme
|
|
29
|
+
Keywords: pyisomme,isomme,iso-mme,iso
|
|
30
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
31
|
+
Classifier: Programming Language :: Python
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Requires-Python: >=3.9
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: matplotlib~=3.7.4
|
|
37
|
+
Requires-Dist: astropy~=6.0.0
|
|
38
|
+
Requires-Dist: pandas~=2.2.0
|
|
39
|
+
Requires-Dist: tqdm~=4.66.1
|
|
40
|
+
Requires-Dist: numpy~=1.26.3
|
|
41
|
+
Requires-Dist: scipy~=1.12.0
|
|
42
|
+
Requires-Dist: python-pptx~=0.6.23
|
|
43
|
+
Requires-Dist: setuptools~=58.1.0
|
|
44
|
+
Requires-Dist: dtwalign~=0.1.1
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: objective_rating_metrics; extra == "dev"
|
|
47
|
+
|
|
48
|
+
# pyisomme
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
pip install pyisomme
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
- Read/write ISO-MME (compressed/uncompressed)
|
|
58
|
+
- Modify Channel and calculate Injury Risk Values (HIC, a3ms, DAMAGE, OLC, BrIC, NIJ, ...)
|
|
59
|
+
- Plot Curves and compare multiple ISO-MMEs
|
|
60
|
+
- Create PowerPoint Reports (Euro-NCAP, UN-R137, UN-R94)
|
|
61
|
+
- Display Limit bars in plots
|
|
62
|
+
- Compare performance of left-hand-drive vehicle with right-hand-drive vehicle
|
|
63
|
+
- Command line tool script for fast and easy use [pyisomme_cmd.py](pyisomme_cmd.py) (list, merge, rename, plot, report, ...)
|
|
64
|
+
|
|
65
|
+
## Command Line Interface
|
|
66
|
+
List all commands with description
|
|
67
|
+
```
|
|
68
|
+
python python_cmd.py --help
|
|
69
|
+
python python_cmd.py <command> --help
|
|
70
|
+
```
|
|
71
|
+
### Examples
|
|
72
|
+
Merge multiple ISO-MME container
|
|
73
|
+
```
|
|
74
|
+
python python_cmd.py merge ./iso_merged.zip ./iso_1/v1.mme ./iso_2.zip ./iso_3.tar.gz
|
|
75
|
+
```
|
|
76
|
+
Resample (start=0ms / step=1ms / stop=100ms) with linear interpolation
|
|
77
|
+
```
|
|
78
|
+
python python_cmd.py merge ./iso_1/v1.mme ./iso_1/v1.mme --resample 0 0.001 0.1
|
|
79
|
+
```
|
|
80
|
+
Plot Channel(s) for quick visualization (automatically calculates resultant head acceleration from x/y/z-channels and filters with filter-class A / 1000 Hz)
|
|
81
|
+
```
|
|
82
|
+
python python_cmd.py plot ./iso_1/v1.mme --codes 24HEAD??????ACRA --xlim 0 100 --calculate
|
|
83
|
+
```
|
|
84
|
+
Create Report (and only consider data from 0-200 ms)
|
|
85
|
+
```
|
|
86
|
+
python python_cmd.py report EuroNCAP_Frontal_MPDB report.pptx data\nhtsa\09203 --crop 0 0.2
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Python Examples
|
|
90
|
+
- [Read ISO-MME](docs/isomme_read.ipynb)
|
|
91
|
+
- [Write ISO-MME](docs/isomme_write.ipynb)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
- [Signal deriviation/integration](docs/channel_diff_int.ipynb)
|
|
95
|
+
- [Add/Subtract/Multiply/Divide Signals](docs/channel_operators.ipynb)
|
|
96
|
+
- [Apply cfc-filter](docs/channel_filter.ipynb)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
- [Plotting](docs/plotting.ipynb)
|
|
100
|
+
|
|
101
|
+
- [Report](docs/report.ipynb)
|
|
102
|
+
|
|
103
|
+
## Limitations
|
|
104
|
+
- Only test-info (.mme), channel-info (.chn) and channel data files (.001/.002/...) are supported. All other files (videos, photos, txt-files) will be ignored when reading and writing.
|
|
105
|
+
- No warning before overwriting! Be careful with merge-command and writing methods.
|
pyisomme-0.0.0/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# pyisomme
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
pip install pyisomme
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
- Read/write ISO-MME (compressed/uncompressed)
|
|
11
|
+
- Modify Channel and calculate Injury Risk Values (HIC, a3ms, DAMAGE, OLC, BrIC, NIJ, ...)
|
|
12
|
+
- Plot Curves and compare multiple ISO-MMEs
|
|
13
|
+
- Create PowerPoint Reports (Euro-NCAP, UN-R137, UN-R94)
|
|
14
|
+
- Display Limit bars in plots
|
|
15
|
+
- Compare performance of left-hand-drive vehicle with right-hand-drive vehicle
|
|
16
|
+
- Command line tool script for fast and easy use [pyisomme_cmd.py](pyisomme_cmd.py) (list, merge, rename, plot, report, ...)
|
|
17
|
+
|
|
18
|
+
## Command Line Interface
|
|
19
|
+
List all commands with description
|
|
20
|
+
```
|
|
21
|
+
python python_cmd.py --help
|
|
22
|
+
python python_cmd.py <command> --help
|
|
23
|
+
```
|
|
24
|
+
### Examples
|
|
25
|
+
Merge multiple ISO-MME container
|
|
26
|
+
```
|
|
27
|
+
python python_cmd.py merge ./iso_merged.zip ./iso_1/v1.mme ./iso_2.zip ./iso_3.tar.gz
|
|
28
|
+
```
|
|
29
|
+
Resample (start=0ms / step=1ms / stop=100ms) with linear interpolation
|
|
30
|
+
```
|
|
31
|
+
python python_cmd.py merge ./iso_1/v1.mme ./iso_1/v1.mme --resample 0 0.001 0.1
|
|
32
|
+
```
|
|
33
|
+
Plot Channel(s) for quick visualization (automatically calculates resultant head acceleration from x/y/z-channels and filters with filter-class A / 1000 Hz)
|
|
34
|
+
```
|
|
35
|
+
python python_cmd.py plot ./iso_1/v1.mme --codes 24HEAD??????ACRA --xlim 0 100 --calculate
|
|
36
|
+
```
|
|
37
|
+
Create Report (and only consider data from 0-200 ms)
|
|
38
|
+
```
|
|
39
|
+
python python_cmd.py report EuroNCAP_Frontal_MPDB report.pptx data\nhtsa\09203 --crop 0 0.2
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Python Examples
|
|
43
|
+
- [Read ISO-MME](docs/isomme_read.ipynb)
|
|
44
|
+
- [Write ISO-MME](docs/isomme_write.ipynb)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
- [Signal deriviation/integration](docs/channel_diff_int.ipynb)
|
|
48
|
+
- [Add/Subtract/Multiply/Divide Signals](docs/channel_operators.ipynb)
|
|
49
|
+
- [Apply cfc-filter](docs/channel_filter.ipynb)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
- [Plotting](docs/plotting.ipynb)
|
|
53
|
+
|
|
54
|
+
- [Report](docs/report.ipynb)
|
|
55
|
+
|
|
56
|
+
## Limitations
|
|
57
|
+
- Only test-info (.mme), channel-info (.chn) and channel data files (.001/.002/...) are supported. All other files (videos, photos, txt-files) will be ignored when reading and writing.
|
|
58
|
+
- No warning before overwriting! Be careful with merge-command and writing methods.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from pyisomme.isomme import *
|
|
2
|
+
from pyisomme.channel import *
|
|
3
|
+
from pyisomme.correlation import Correlation_ISO18571
|
|
4
|
+
from pyisomme.plotting import *
|
|
5
|
+
from pyisomme.unit import *
|
|
6
|
+
from pyisomme.limits import *
|
|
7
|
+
from pyisomme.code import *
|
|
8
|
+
|
|
9
|
+
import pyisomme.report
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import logging
|
|
3
|
+
import pandas as pd
|
|
4
|
+
import numpy as np
|
|
5
|
+
|
|
6
|
+
import pyisomme
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
REPORTS = [
|
|
10
|
+
pyisomme.report.euro_ncap.frontal_mpdb.EuroNCAP_Frontal_MPDB,
|
|
11
|
+
pyisomme.report.euro_ncap.frontal_50kmh.EuroNCAP_Frontal_50kmh,
|
|
12
|
+
pyisomme.report.euro_ncap.side_barrier.EuroNCAP_Side_Barrier,
|
|
13
|
+
pyisomme.report.euro_ncap.side_pole.EuroNCAP_Side_Pole,
|
|
14
|
+
pyisomme.report.euro_ncap.side_farside.EuroNCAP_Side_FarSide,
|
|
15
|
+
pyisomme.report.euro_ncap.side_farside_vtc.EuroNCAP_Side_Farside_VTC,
|
|
16
|
+
pyisomme.report.un.frontal_50kmh_r137.UN_Frontal_50kmh_R137,
|
|
17
|
+
pyisomme.report.un.frontal_56kmh_odb_r94.UN_Frontal_56kmh_ODB_R94,
|
|
18
|
+
pyisomme.report.un.side_pole_r135.UN_Side_Pole_R135,
|
|
19
|
+
pyisomme.report.un.side_barrier_r95.UN_Side_Barrier_R95,
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def main():
|
|
24
|
+
logging.basicConfig(format='%(module)-12s %(levelname)-8s %(message)s',
|
|
25
|
+
datefmt='%m/%d/%Y %I:%M:%S',
|
|
26
|
+
level=logging.INFO if options.verbose else logging.WARNING)
|
|
27
|
+
|
|
28
|
+
if options.command == 'list':
|
|
29
|
+
for isomme in [pyisomme.Isomme().read(input_path) for input_path in options.input_paths]:
|
|
30
|
+
print("\n")
|
|
31
|
+
print(isomme.test_number)
|
|
32
|
+
|
|
33
|
+
if len(options.codes) == 0:
|
|
34
|
+
channels = isomme.channels
|
|
35
|
+
else:
|
|
36
|
+
channels = isomme.get_channels(*options.codes, filter=False, calculate=False, integrate=False, differentiate=False)
|
|
37
|
+
|
|
38
|
+
for channel in channels:
|
|
39
|
+
print(channel.code)
|
|
40
|
+
|
|
41
|
+
if options.command == "merge":
|
|
42
|
+
merged_isomme = pyisomme.Isomme().read(options.input_paths[0], *options.codes)
|
|
43
|
+
for other_input_path in options.input_paths[1:]:
|
|
44
|
+
merged_isomme.extend(pyisomme.Isomme().read(other_input_path, *options.codes))
|
|
45
|
+
|
|
46
|
+
if options.delete_duplicates or options.delete_filter_duplicates:
|
|
47
|
+
merged_isomme.delete_duplicates(filter_class_duplicates=options.delete_filter_duplicates)
|
|
48
|
+
|
|
49
|
+
for channel in merged_isomme.channels:
|
|
50
|
+
channel.set_code(test_object=options.test_object,
|
|
51
|
+
position=options.position,
|
|
52
|
+
main_location=options.main_location,
|
|
53
|
+
fine_location_1=options.fine_location_1,
|
|
54
|
+
fine_location_2=options.fine_location_2,
|
|
55
|
+
fine_location_3=options.fine_location_3,
|
|
56
|
+
physical_dimension=options.physical_dimension,
|
|
57
|
+
direction=options.direction,
|
|
58
|
+
filter_class=options.filter_class)
|
|
59
|
+
if options.auto_offset_y:
|
|
60
|
+
channel.auto_offset_y()
|
|
61
|
+
channel.scale_y(options.scale_y)
|
|
62
|
+
channel.offset_y(options.offset_y)
|
|
63
|
+
channel.scale_x(options.scale_x)
|
|
64
|
+
channel.offset_x(options.offset_x)
|
|
65
|
+
|
|
66
|
+
if options.cfc is not None:
|
|
67
|
+
channel.cfc(options.cfc, return_copy=False)
|
|
68
|
+
|
|
69
|
+
if options.resample:
|
|
70
|
+
for channel in merged_isomme.channels:
|
|
71
|
+
start, step, stop = options.resample
|
|
72
|
+
t = np.arange(start, stop+step, step)
|
|
73
|
+
channel.data = pd.DataFrame(channel.get_data(t=t), index=t)
|
|
74
|
+
|
|
75
|
+
if options.crop:
|
|
76
|
+
merged_isomme.crop(*options.crop)
|
|
77
|
+
|
|
78
|
+
if options.append:
|
|
79
|
+
try:
|
|
80
|
+
existing_isomme = pyisomme.Isomme().read(options.output_path)
|
|
81
|
+
existing_isomme.extend(merged_isomme)
|
|
82
|
+
existing_isomme.write(options.output_path)
|
|
83
|
+
except Exception:
|
|
84
|
+
merged_isomme.write(options.output_path)
|
|
85
|
+
else:
|
|
86
|
+
merged_isomme.write(options.output_path)
|
|
87
|
+
|
|
88
|
+
if options.command == "report":
|
|
89
|
+
isomme_list = [pyisomme.Isomme().read(input_path) for input_path in options.input_paths]
|
|
90
|
+
|
|
91
|
+
if options.crop:
|
|
92
|
+
for isomme in isomme_list:
|
|
93
|
+
isomme.crop(options.crop)
|
|
94
|
+
|
|
95
|
+
report = {report.__name__: report for report in REPORTS}[options.report_name](isomme_list)
|
|
96
|
+
report.calculate()
|
|
97
|
+
report.export_pptx(options.report_path, template=options.template)
|
|
98
|
+
|
|
99
|
+
if options.command == "plot":
|
|
100
|
+
if options.calculate:
|
|
101
|
+
isomme_list = [pyisomme.Isomme().read(input_path) for input_path in options.input_paths]
|
|
102
|
+
else:
|
|
103
|
+
isomme_list = [pyisomme.Isomme().read(input_path, *options.codes) for input_path in options.input_paths]
|
|
104
|
+
n = slice(None, options.n)
|
|
105
|
+
|
|
106
|
+
pyisomme.Plot_Line({isomme: [isomme.get_channels(*options.codes)[n]] for isomme in isomme_list},
|
|
107
|
+
xlim=options.xlim,
|
|
108
|
+
ylim=options.ylim,
|
|
109
|
+
legend=options.legend).show()
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
if __name__ == "__main__":
|
|
113
|
+
parser = argparse.ArgumentParser()
|
|
114
|
+
|
|
115
|
+
parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", help="Verbose mode")
|
|
116
|
+
|
|
117
|
+
command_parsers = parser.add_subparsers(dest="command", required=True)
|
|
118
|
+
|
|
119
|
+
list_parser = command_parsers.add_parser("list")
|
|
120
|
+
list_parser.add_argument(nargs="+",
|
|
121
|
+
dest="input_paths",
|
|
122
|
+
help="ISO-MME Path (.mme/folder/.zip/.tar/.tar.gz/...)")
|
|
123
|
+
list_parser.add_argument("-c", "--codes",
|
|
124
|
+
nargs="*",
|
|
125
|
+
dest="codes",
|
|
126
|
+
default=[],
|
|
127
|
+
help="Channel Code Patterns to filter ISO-MMEs")
|
|
128
|
+
|
|
129
|
+
merge_parser = command_parsers.add_parser("merge", help="Merge ISO-MMEs")
|
|
130
|
+
merge_parser.add_argument(dest="output_path",
|
|
131
|
+
help="ISO-MME Path (.mme/folder/.zip/.tar/.tar.gz/...)")
|
|
132
|
+
merge_parser.add_argument(nargs="+",
|
|
133
|
+
dest="input_paths",
|
|
134
|
+
help="ISO-MME Path (.mme/folder/.zip/.tar/.tar.gz/...)")
|
|
135
|
+
merge_parser.add_argument("-c", "--codes",
|
|
136
|
+
nargs="*",
|
|
137
|
+
dest="codes",
|
|
138
|
+
default=[],
|
|
139
|
+
help="Channel Code Patterns to filter ISO-MMEs")
|
|
140
|
+
merge_parser.add_argument("--delete-duplicates",
|
|
141
|
+
action="store_true",
|
|
142
|
+
dest="delete_duplicates",
|
|
143
|
+
help="Delete duplicate channels (same channel code)")
|
|
144
|
+
merge_parser.add_argument("--delete-filter-duplicates",
|
|
145
|
+
action="store_true",
|
|
146
|
+
dest="delete_filter_duplicates",
|
|
147
|
+
help="Delete filtered channels if channel with less filtering exists. "
|
|
148
|
+
"Includes '--delete-duplicates' option")
|
|
149
|
+
merge_parser.add_argument("--set-test-object", dest="test_object")
|
|
150
|
+
merge_parser.add_argument("--set-position", dest="position")
|
|
151
|
+
merge_parser.add_argument("--set-main-location", dest="main_location")
|
|
152
|
+
merge_parser.add_argument("--set-fine-location-1", dest="fine_location_1")
|
|
153
|
+
merge_parser.add_argument("--set-fine-location-2", dest="fine_location_2")
|
|
154
|
+
merge_parser.add_argument("--set-fine-location-3", dest="fine_location_3")
|
|
155
|
+
merge_parser.add_argument("--set-physical-dimension", dest="physical_dimension")
|
|
156
|
+
merge_parser.add_argument("--set-direction", dest="direction")
|
|
157
|
+
merge_parser.add_argument("--set-filter-class", dest="filter_class")
|
|
158
|
+
merge_parser.add_argument("--scale-x", default=1, dest="scale_x")
|
|
159
|
+
merge_parser.add_argument("--scale-y", default=1, dest="scale_y")
|
|
160
|
+
merge_parser.add_argument("--offset-x", default=0, dest="offset_x")
|
|
161
|
+
merge_parser.add_argument("--offset-y", default=0, dest="offset_y")
|
|
162
|
+
merge_parser.add_argument("--auto-offset-y",
|
|
163
|
+
action="store_true",
|
|
164
|
+
dest="auto_offset_y",
|
|
165
|
+
help="Apply y-offset with value from t=0")
|
|
166
|
+
merge_parser.add_argument("--append",
|
|
167
|
+
action="store_true",
|
|
168
|
+
dest="append",
|
|
169
|
+
help="Append channels to ISO-MME if output_path exists")
|
|
170
|
+
merge_parser.add_argument('--resample',
|
|
171
|
+
nargs=3,
|
|
172
|
+
type=float,
|
|
173
|
+
metavar=('START', 'STEP', 'STOP'),
|
|
174
|
+
help='Resampling by linear interpolation (no extrapolation)')
|
|
175
|
+
merge_parser.add_argument("--crop",
|
|
176
|
+
dest="crop",
|
|
177
|
+
nargs=2,
|
|
178
|
+
type=float,
|
|
179
|
+
metavar=('START', 'STOP'),
|
|
180
|
+
help="Crop ISO-MME channels to x-min to x-max e.g. (--crop 0.0 0.15)")
|
|
181
|
+
merge_parser.add_argument("--cfc",
|
|
182
|
+
dest="cfc",
|
|
183
|
+
help="Filter channels with Channel Frequency Class CFC (in Hz or as ISO-Code A/B/C/..)")
|
|
184
|
+
|
|
185
|
+
report_parser = command_parsers.add_parser("report", help="Create a Report")
|
|
186
|
+
report_parser.add_argument(dest="report_name",
|
|
187
|
+
choices=[report.__name__ for report in REPORTS],
|
|
188
|
+
help="Report name")
|
|
189
|
+
report_parser.add_argument(dest="report_path",
|
|
190
|
+
help="Report Path (.pptx)")
|
|
191
|
+
report_parser.add_argument(nargs="+",
|
|
192
|
+
dest="input_paths",
|
|
193
|
+
help="ISO-MME Path (.mme/folder/.zip/.tar/.tar.gz/...)")
|
|
194
|
+
report_parser.add_argument("--template",
|
|
195
|
+
dest="template",
|
|
196
|
+
help="Path to Template (.pptx)")
|
|
197
|
+
report_parser.add_argument("--crop",
|
|
198
|
+
dest="crop",
|
|
199
|
+
nargs=2,
|
|
200
|
+
type=float,
|
|
201
|
+
metavar=('START', 'STOP'),
|
|
202
|
+
help="Crop ISO-MME channels to x-min to x-max e.g. (--crop 0.0 0.15)")
|
|
203
|
+
|
|
204
|
+
plot_parser = command_parsers.add_parser("plot", help="Plot Channels")
|
|
205
|
+
plot_parser.add_argument(nargs="+",
|
|
206
|
+
dest="input_paths",
|
|
207
|
+
help="ISO-MME Path (.mme/folder/.zip/.tar/.tar.gz/...)")
|
|
208
|
+
plot_parser.add_argument("-c", "--codes",
|
|
209
|
+
nargs="*",
|
|
210
|
+
dest="codes",
|
|
211
|
+
default=[],
|
|
212
|
+
help="Channel Code Patterns to select Channel to plot")
|
|
213
|
+
plot_parser.add_argument("--calculate",
|
|
214
|
+
action="store_true",
|
|
215
|
+
dest="calculate",
|
|
216
|
+
help="Plot calculated Channel.")
|
|
217
|
+
plot_parser.add_argument("-n", "--n-channels",
|
|
218
|
+
type=int,
|
|
219
|
+
dest="n",
|
|
220
|
+
help="Limit Number of channels to plot")
|
|
221
|
+
plot_parser.add_argument("-x", "--xlim",
|
|
222
|
+
dest="xlim",
|
|
223
|
+
nargs=2,
|
|
224
|
+
type=float,
|
|
225
|
+
metavar=('START', 'STOP'),
|
|
226
|
+
help="X-Axis Range [in ms]")
|
|
227
|
+
plot_parser.add_argument("-y", "--ylim",
|
|
228
|
+
dest="ylim",
|
|
229
|
+
nargs=2,
|
|
230
|
+
type=float,
|
|
231
|
+
metavar=('START', 'STOP'),
|
|
232
|
+
help="Y-Axis Range")
|
|
233
|
+
plot_parser.add_argument("--legend-off",
|
|
234
|
+
dest="legend",
|
|
235
|
+
action="store_false",
|
|
236
|
+
help="Hide legend")
|
|
237
|
+
|
|
238
|
+
options = parser.parse_args()
|
|
239
|
+
|
|
240
|
+
main()
|