SimbioReader 0.6.1__tar.gz → 0.6.3__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.
- {simbioreader-0.6.1/src/SimbioReader.egg-info → simbioreader-0.6.3}/PKG-INFO +7 -2
- {simbioreader-0.6.1 → simbioreader-0.6.3}/README.md +6 -1
- {simbioreader-0.6.1 → simbioreader-0.6.3}/pyproject.toml +1 -1
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/constants.py +1 -1
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/filters.py +13 -1
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/filters_tools.py +6 -4
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/simbioInfo.py +1 -1
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/sr.py +6 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/tools.py +23 -10
- {simbioreader-0.6.1 → simbioreader-0.6.3/src/SimbioReader.egg-info}/PKG-INFO +7 -2
- {simbioreader-0.6.1 → simbioreader-0.6.3}/test/test_new_format.py +2 -2
- {simbioreader-0.6.1 → simbioreader-0.6.3}/LICENSE +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/setup.cfg +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/__init__.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/__main__.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/cli.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/exceptions.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/infocli.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/phases.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/subphases.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/tests.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader/version.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader.egg-info/SOURCES.txt +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader.egg-info/dependency_links.txt +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader.egg-info/entry_points.txt +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader.egg-info/requires.txt +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/src/SimbioReader.egg-info/top_level.txt +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/test/test_db.py +0 -0
- {simbioreader-0.6.1 → simbioreader-0.6.3}/test/test_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SimbioReader
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: Python Reader for the data from SIMBIO-SYS instrument suite on-board the ESA mission BepiColombo
|
|
5
5
|
Author-email: Romolo Politi <Romolo.Politi@inaf.it>
|
|
6
6
|
Project-URL: Repository, https://github.com/SIMBIO-SYS/SimbioReader
|
|
@@ -26,7 +26,6 @@ Dynamic: license-file
|
|
|
26
26
|

|
|
27
27
|

|
|
28
28
|

|
|
29
|
-
[](https://github.com/SIMBIO-SYS/SimbioReader/actions/workflows/python-publish.yml)
|
|
30
29
|
[](https://github.com/SIMBIO-SYS/SimbioReader/actions/workflows/test.yml)
|
|
31
30
|
[](https://simbioreader.readthedocs.io/en/latest/?badge=latest)
|
|
32
31
|
|
|
@@ -45,6 +44,12 @@ To install the reader you can use the command:
|
|
|
45
44
|
$ python3 -m pip install SimbioReader
|
|
46
45
|
```
|
|
47
46
|
|
|
47
|
+
or using poetry
|
|
48
|
+
|
|
49
|
+
```console
|
|
50
|
+
$ poetry add SimbioReader
|
|
51
|
+
```
|
|
52
|
+
|
|
48
53
|
## Usage
|
|
49
54
|
|
|
50
55
|
The package contain a class that read and decode the SIMBIO-SYS image
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|

|
|
2
2
|

|
|
3
3
|

|
|
4
|
-
[](https://github.com/SIMBIO-SYS/SimbioReader/actions/workflows/python-publish.yml)
|
|
5
4
|
[](https://github.com/SIMBIO-SYS/SimbioReader/actions/workflows/test.yml)
|
|
6
5
|
[](https://simbioreader.readthedocs.io/en/latest/?badge=latest)
|
|
7
6
|
|
|
@@ -20,6 +19,12 @@ To install the reader you can use the command:
|
|
|
20
19
|
$ python3 -m pip install SimbioReader
|
|
21
20
|
```
|
|
22
21
|
|
|
22
|
+
or using poetry
|
|
23
|
+
|
|
24
|
+
```console
|
|
25
|
+
$ poetry add SimbioReader
|
|
26
|
+
```
|
|
27
|
+
|
|
23
28
|
## Usage
|
|
24
29
|
|
|
25
30
|
The package contain a class that read and decode the SIMBIO-SYS image
|
|
@@ -19,7 +19,7 @@ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
|
|
|
19
19
|
progEpilog = "- For any information or suggestion please contact " \
|
|
20
20
|
"[bold magenta]Romolo.Politi@inaf.it[/bold magenta]"
|
|
21
21
|
|
|
22
|
-
VERSION = (0,6,
|
|
22
|
+
VERSION = (0,6,2,'f',1)
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
datamodel='1.22.0.0'
|
|
@@ -139,7 +139,19 @@ hricFilters={
|
|
|
139
139
|
"cust0":{
|
|
140
140
|
"name" : "PAN-L - custom",
|
|
141
141
|
"desc" : "Fraction of the CCD used by the PAN-L filter",
|
|
142
|
-
"id" : "
|
|
142
|
+
"id" : "CUST-0",
|
|
143
|
+
"bandwidth" : "204.3",
|
|
144
|
+
"centerFilter" : "699.5",
|
|
145
|
+
"interframeDel": "0.8",
|
|
146
|
+
"fistLine" : "1227",
|
|
147
|
+
"firstSample" : "576",
|
|
148
|
+
"line" : "384",
|
|
149
|
+
"sample" : "896"
|
|
150
|
+
},
|
|
151
|
+
"cust1":{
|
|
152
|
+
"name" : "PAN-L - custom",
|
|
153
|
+
"desc" : "Fraction of the CCD used by the PAN-L filter",
|
|
154
|
+
"id" : "CUST-1",
|
|
143
155
|
"bandwidth" : "204.3",
|
|
144
156
|
"centerFilter" : "699.5",
|
|
145
157
|
"interframeDel": "0.8",
|
|
@@ -15,11 +15,13 @@ class Filter:
|
|
|
15
15
|
raise ValueError("Invalid channel.")
|
|
16
16
|
itm = [elem for elem in flt.values() if elem['name']==name]
|
|
17
17
|
if len(itm)==0:
|
|
18
|
-
|
|
18
|
+
itm=[elem for elem in flt.values() if elem['id']=='CUST-0']
|
|
19
|
+
# raise ValueError("No filters found.")
|
|
19
20
|
elif len(itm)>1:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
pass
|
|
22
|
+
# raise ValueError("Multiple filters found. Please provide a detailed filter name.")
|
|
23
|
+
# elif len(itm)==1:
|
|
24
|
+
itm=itm[0]
|
|
23
25
|
|
|
24
26
|
for key, value in itm.items():
|
|
25
27
|
setattr(self, key, value)
|
|
@@ -44,7 +44,7 @@ class Phase:
|
|
|
44
44
|
dt = parse(dt,ignoretz=True)
|
|
45
45
|
phase_data = self._find_phase_by_date(dt)
|
|
46
46
|
if not phase_data:
|
|
47
|
-
raise ValueError("No phase found for the given date.")
|
|
47
|
+
raise ValueError(f"No phase found for the given date. (dt: {dt})")
|
|
48
48
|
else:
|
|
49
49
|
raise ValueError("You must provide a phase name or a date.")
|
|
50
50
|
|
|
@@ -780,4 +780,10 @@ class SimbioReader:
|
|
|
780
780
|
"""
|
|
781
781
|
data = im.fromarray(self.img)
|
|
782
782
|
return data
|
|
783
|
+
|
|
784
|
+
def __str__(self) -> str:
|
|
785
|
+
return f"SimbioReader(channel={self.channel}, level={self.level}, lid={self.lid}, version={self.version})"
|
|
786
|
+
|
|
787
|
+
def __repr__(self) -> str:
|
|
788
|
+
return self.__str__()
|
|
783
789
|
|
|
@@ -4,23 +4,36 @@ from pathlib import Path
|
|
|
4
4
|
import copy
|
|
5
5
|
|
|
6
6
|
def getValue(nodeList: md.Element, label: str) -> str:
|
|
7
|
-
"""
|
|
8
|
-
|
|
7
|
+
"""Extracts and returns the text content of the first matching XML element.
|
|
8
|
+
This function searches for an XML element with the specified tag name within
|
|
9
|
+
a given node list and returns the text data of the first matching element's
|
|
10
|
+
first child node.
|
|
9
11
|
Args:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
nodeList (md.Element): The parent XML element to search within.
|
|
13
|
+
label (str): The tag name of the XML element to retrieve.
|
|
12
14
|
Returns:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
str: The text content of the first matching element's first child node.
|
|
16
|
+
Raises:
|
|
17
|
+
IndexError: If no element with the specified label is found.
|
|
18
|
+
AttributeError: If the found element has no firstChild or the firstChild
|
|
19
|
+
has no data attribute.
|
|
20
|
+
Example:
|
|
21
|
+
>>> import xml.dom.minidom as md
|
|
22
|
+
>>> xml_string = '<root><name>John Doe</name><age>30</age></root>'
|
|
23
|
+
>>> doc = md.parseString(xml_string)
|
|
24
|
+
>>> root = doc.documentElement
|
|
25
|
+
>>> getValue(root, 'name')
|
|
26
|
+
'John Doe'
|
|
27
|
+
>>> getValue(root, 'age')
|
|
28
|
+
'30'
|
|
15
29
|
"""
|
|
16
|
-
|
|
17
|
-
# print(item)
|
|
30
|
+
|
|
18
31
|
elem = nodeList.getElementsByTagName(label)
|
|
19
32
|
return elem[0].firstChild.data
|
|
20
|
-
|
|
33
|
+
|
|
21
34
|
|
|
22
35
|
|
|
23
|
-
def getElement(doc, label, el=0) -> md.Element:
|
|
36
|
+
def getElement(doc:md.Document, label:str, el:int=0) -> md.Element:
|
|
24
37
|
"""Get a Block of a dom
|
|
25
38
|
|
|
26
39
|
Args:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SimbioReader
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: Python Reader for the data from SIMBIO-SYS instrument suite on-board the ESA mission BepiColombo
|
|
5
5
|
Author-email: Romolo Politi <Romolo.Politi@inaf.it>
|
|
6
6
|
Project-URL: Repository, https://github.com/SIMBIO-SYS/SimbioReader
|
|
@@ -26,7 +26,6 @@ Dynamic: license-file
|
|
|
26
26
|

|
|
27
27
|

|
|
28
28
|

|
|
29
|
-
[](https://github.com/SIMBIO-SYS/SimbioReader/actions/workflows/python-publish.yml)
|
|
30
29
|
[](https://github.com/SIMBIO-SYS/SimbioReader/actions/workflows/test.yml)
|
|
31
30
|
[](https://simbioreader.readthedocs.io/en/latest/?badge=latest)
|
|
32
31
|
|
|
@@ -45,6 +44,12 @@ To install the reader you can use the command:
|
|
|
45
44
|
$ python3 -m pip install SimbioReader
|
|
46
45
|
```
|
|
47
46
|
|
|
47
|
+
or using poetry
|
|
48
|
+
|
|
49
|
+
```console
|
|
50
|
+
$ poetry add SimbioReader
|
|
51
|
+
```
|
|
52
|
+
|
|
48
53
|
## Usage
|
|
49
54
|
|
|
50
55
|
The package contain a class that read and decode the SIMBIO-SYS image
|
|
@@ -71,8 +71,8 @@ def test_simbio_reader_init_datamodel_version():
|
|
|
71
71
|
def test_simbio_reader_init_start_stop_time():
|
|
72
72
|
file_path = Path("test/data/sim_cal_stc_cruise_ico11_2024-04-08_001/sim_cal_sc_stc_cruise_ico11_2024-04-08_001__0_1.lblx")
|
|
73
73
|
reader = SimbioReader(file_path=file_path)
|
|
74
|
-
assert reader.startTime.isoformat() == "2024-04-08T01:05:18.055390
|
|
75
|
-
assert reader.stopTime.isoformat() == "2024-04-08T01:05:18.055390
|
|
74
|
+
assert reader.startTime.isoformat() == "2024-04-08T01:05:18.055390"
|
|
75
|
+
assert reader.stopTime.isoformat() == "2024-04-08T01:05:18.055390"
|
|
76
76
|
|
|
77
77
|
def test_simbio_reader_init_start_stop_scet():
|
|
78
78
|
file_path = Path("test/data/sim_cal_stc_cruise_ico11_2024-04-08_001/sim_cal_sc_stc_cruise_ico11_2024-04-08_001__0_1.lblx")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|