kuva-reader 0.1.4__tar.gz → 1.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.
Potentially problematic release.
This version of kuva-reader might be problematic. Click here for more details.
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/PKG-INFO +8 -21
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/README.md +5 -18
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/level0.py +9 -17
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/level1.py +8 -7
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/level2.py +8 -7
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/pyproject.toml +9 -9
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/__init__.py +0 -0
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/py.typed +0 -0
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/__init__.py +0 -0
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/image.py +0 -0
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/product_base.py +0 -0
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/py.typed +0 -0
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/read.py +0 -0
- {kuva_reader-0.1.4 → kuva_reader-1.0.0}/kuva_reader/reader/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kuva-reader
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Manipulate the Kuva Space image and metadata formats
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Guillem Ballesteros
|
|
@@ -11,8 +11,8 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Requires-Dist: kuva-geometry
|
|
15
|
-
Requires-Dist: kuva-metadata
|
|
14
|
+
Requires-Dist: kuva-geometry @ file:///home/olli/projects/kuva-repos/kuva-data-processing/kuva-geometry
|
|
15
|
+
Requires-Dist: kuva-metadata @ file:///home/olli/projects/kuva-repos/kuva-data-processing/kuva-metadata
|
|
16
16
|
Requires-Dist: numpy (>=1.26.4,<2.0.0)
|
|
17
17
|
Requires-Dist: numpy-quaternion (>=2022.4.4,<2023.0.0)
|
|
18
18
|
Requires-Dist: pint (>=0.22,<0.23)
|
|
@@ -39,19 +39,6 @@ The metadata lives either in a Kuva Space database, or alternatively in a sideca
|
|
|
39
39
|
This library allows the reading of the image GeoTIFFs into `xarray.Dataset` objects that
|
|
40
40
|
allow convenient raster manipulations, along with their `kuva-metadata` metadata objects.
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
# Table of Contents
|
|
44
|
-
|
|
45
|
-
- [Installation](#installation)
|
|
46
|
-
- [Code](#code)
|
|
47
|
-
- [Minimal example](#minimal-example)
|
|
48
|
-
- [Processing levels](#processing-levels)
|
|
49
|
-
- [Special tags](#special-tags)
|
|
50
|
-
- [Contributing](#contributing)
|
|
51
|
-
- [Configuration](#configuration)
|
|
52
|
-
- [Contact information](#contact-information)
|
|
53
|
-
- [License](#license)
|
|
54
|
-
|
|
55
42
|
# Installation
|
|
56
43
|
|
|
57
44
|
```bash
|
|
@@ -73,7 +60,7 @@ The loaded product is stored in a `rioxarray` object, which contains extensive G
|
|
|
73
60
|
```python
|
|
74
61
|
from kuva_reader import read_product
|
|
75
62
|
|
|
76
|
-
|
|
63
|
+
l2a_product = read_product("my_data_folder/hyperfield1a_L2A_20250105T092548")
|
|
77
64
|
print(product) # Will show some main information such as image shape and CRS
|
|
78
65
|
```
|
|
79
66
|
|
|
@@ -111,10 +98,10 @@ be messed with.
|
|
|
111
98
|
|
|
112
99
|
# Contributing
|
|
113
100
|
|
|
114
|
-
Please follow the guidelines in [CONTRIBUTING.md](
|
|
101
|
+
Please follow the guidelines in [CONTRIBUTING.md](https://github.com/KuvaSpace/kuva-data-processing/blob/main/CONTRIBUTING.md).
|
|
115
102
|
|
|
116
|
-
Also, please follow our [Code of Conduct](
|
|
117
|
-
issues and pull requests.
|
|
103
|
+
Also, please follow our [Code of Conduct](https://github.com/KuvaSpace/kuva-data-processing/blob/main/CODE_OF_CONDUCT.md)
|
|
104
|
+
while discussing in the issues and pull requests.
|
|
118
105
|
|
|
119
106
|
# Contact information
|
|
120
107
|
|
|
@@ -123,7 +110,7 @@ feel free to send them an email explaining your issue.
|
|
|
123
110
|
|
|
124
111
|
# License
|
|
125
112
|
|
|
126
|
-
The `kuva-reader` project software is under the [MIT license](
|
|
113
|
+
The `kuva-reader` project software is under the [MIT license](https://github.com/KuvaSpace/kuva-data-processing/blob/main/LICENSE.md).
|
|
127
114
|
|
|
128
115
|
# Status of unit tests
|
|
129
116
|
|
|
@@ -16,19 +16,6 @@ The metadata lives either in a Kuva Space database, or alternatively in a sideca
|
|
|
16
16
|
This library allows the reading of the image GeoTIFFs into `xarray.Dataset` objects that
|
|
17
17
|
allow convenient raster manipulations, along with their `kuva-metadata` metadata objects.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
# Table of Contents
|
|
21
|
-
|
|
22
|
-
- [Installation](#installation)
|
|
23
|
-
- [Code](#code)
|
|
24
|
-
- [Minimal example](#minimal-example)
|
|
25
|
-
- [Processing levels](#processing-levels)
|
|
26
|
-
- [Special tags](#special-tags)
|
|
27
|
-
- [Contributing](#contributing)
|
|
28
|
-
- [Configuration](#configuration)
|
|
29
|
-
- [Contact information](#contact-information)
|
|
30
|
-
- [License](#license)
|
|
31
|
-
|
|
32
19
|
# Installation
|
|
33
20
|
|
|
34
21
|
```bash
|
|
@@ -50,7 +37,7 @@ The loaded product is stored in a `rioxarray` object, which contains extensive G
|
|
|
50
37
|
```python
|
|
51
38
|
from kuva_reader import read_product
|
|
52
39
|
|
|
53
|
-
|
|
40
|
+
l2a_product = read_product("my_data_folder/hyperfield1a_L2A_20250105T092548")
|
|
54
41
|
print(product) # Will show some main information such as image shape and CRS
|
|
55
42
|
```
|
|
56
43
|
|
|
@@ -88,10 +75,10 @@ be messed with.
|
|
|
88
75
|
|
|
89
76
|
# Contributing
|
|
90
77
|
|
|
91
|
-
Please follow the guidelines in [CONTRIBUTING.md](
|
|
78
|
+
Please follow the guidelines in [CONTRIBUTING.md](https://github.com/KuvaSpace/kuva-data-processing/blob/main/CONTRIBUTING.md).
|
|
92
79
|
|
|
93
|
-
Also, please follow our [Code of Conduct](
|
|
94
|
-
issues and pull requests.
|
|
80
|
+
Also, please follow our [Code of Conduct](https://github.com/KuvaSpace/kuva-data-processing/blob/main/CODE_OF_CONDUCT.md)
|
|
81
|
+
while discussing in the issues and pull requests.
|
|
95
82
|
|
|
96
83
|
# Contact information
|
|
97
84
|
|
|
@@ -100,7 +87,7 @@ feel free to send them an email explaining your issue.
|
|
|
100
87
|
|
|
101
88
|
# License
|
|
102
89
|
|
|
103
|
-
The `kuva-reader` project software is under the [MIT license](
|
|
90
|
+
The `kuva-reader` project software is under the [MIT license](https://github.com/KuvaSpace/kuva-data-processing/blob/main/LICENSE.md).
|
|
104
91
|
|
|
105
92
|
# Status of unit tests
|
|
106
93
|
|
|
@@ -103,14 +103,15 @@ class Level0Product(ProductBase[MetadataLevel0]):
|
|
|
103
103
|
|
|
104
104
|
def __repr__(self):
|
|
105
105
|
"""Pretty printing of the object with the most important info"""
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
if self.images is not None and len(self.images):
|
|
107
|
+
return (
|
|
108
|
+
f"{self.__class__.__name__}"
|
|
109
|
+
f"with {len(self.images)} frames of shape {self.images[0].shape} "
|
|
110
|
+
f"and CRS '{self.images[0].rio.crs}'. "
|
|
111
|
+
f"Loaded from: '{self.image_path}'."
|
|
112
|
+
)
|
|
113
|
+
else:
|
|
114
|
+
return f"{self.__class__.__name__} loaded from '{self.image_path}'."
|
|
114
115
|
|
|
115
116
|
def __getitem__(self, camera: str) -> xarray.DataArray:
|
|
116
117
|
"""Return the datarray for the chosen camera."""
|
|
@@ -232,15 +233,6 @@ class Level0Product(ProductBase[MetadataLevel0]):
|
|
|
232
233
|
bad_pixel_filename = f"{camera}_per_frame_cloud_mask.tif"
|
|
233
234
|
return self._read_array(self.image_path / bad_pixel_filename)
|
|
234
235
|
|
|
235
|
-
def release_memory(self):
|
|
236
|
-
"""Explicitely releases the memory of the `images` variable.
|
|
237
|
-
|
|
238
|
-
NOTE: this function is implemented because of a memory leak inside the Rioxarray
|
|
239
|
-
library that doesn't release memory properly. Only use it when the image data is
|
|
240
|
-
not needed anymore.
|
|
241
|
-
"""
|
|
242
|
-
del self.images
|
|
243
|
-
self.images = None
|
|
244
236
|
|
|
245
237
|
def generate_level_0_metafile():
|
|
246
238
|
"""Example function for reading a product and generating a metadata file from the
|
|
@@ -166,13 +166,14 @@ class Level1CProduct(ProductBase[MetadataLevel1C]):
|
|
|
166
166
|
|
|
167
167
|
def __repr__(self):
|
|
168
168
|
"""Pretty printing of the object with the most important info"""
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
if self.image is not None:
|
|
170
|
+
return (
|
|
171
|
+
f"{self.__class__.__name__} with shape {self.image.shape} "
|
|
172
|
+
f"and wavelengths {self.wavelengths} (CRS: '{self.image.rio.crs}'). "
|
|
173
|
+
f"Loaded from: '{self.image_path}'."
|
|
174
|
+
)
|
|
175
|
+
else:
|
|
176
|
+
return f"{self.__class__.__name__} loaded from '{self.image_path}'"
|
|
176
177
|
|
|
177
178
|
def _get_data_from_sidecar(
|
|
178
179
|
self, sidecar_path: Path, target_ureg: UnitRegistry | None = None
|
|
@@ -58,13 +58,14 @@ class Level2AProduct(ProductBase[MetadataLevel2A]):
|
|
|
58
58
|
|
|
59
59
|
def __repr__(self):
|
|
60
60
|
"""Pretty printing of the object with the most important info"""
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
if self.image is not None:
|
|
62
|
+
return (
|
|
63
|
+
f"{self.__class__.__name__} with shape {self.image.shape} "
|
|
64
|
+
f"and wavelengths {self.wavelengths} (CRS: '{self.image.rio.crs}'). "
|
|
65
|
+
f"Loaded from: '{self.image_path}'."
|
|
66
|
+
)
|
|
67
|
+
else:
|
|
68
|
+
return f"{self.__class__.__name__} loaded from '{self.image_path}'"
|
|
68
69
|
|
|
69
70
|
def _get_data_from_sidecar(
|
|
70
71
|
self, sidecar_path: Path, target_ureg: UnitRegistry | None = None
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "kuva-reader"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "1.0.0"
|
|
8
8
|
description = "Manipulate the Kuva Space image and metadata formats"
|
|
9
9
|
authors = ["Guillem Ballesteros <guillem@kuvaspace.com>" , "Lennert Antson <lennert.antson@kuvaspace.com>", "Arthur Vandenhoeke <arthur.vandenhoeke@kuvaspace.com>", "Olli Eloranta <olli.eloranta@kuvaspace.com>"]
|
|
10
10
|
readme = "README.md"
|
|
@@ -30,17 +30,17 @@ pint = "^0.22"
|
|
|
30
30
|
rasterio = "^1.4.1"
|
|
31
31
|
xarray = "^2022.12.0"
|
|
32
32
|
rioxarray = "^0.12.4"
|
|
33
|
-
kuva-geometry = "*"
|
|
34
|
-
kuva-metadata = "*"
|
|
33
|
+
# kuva-geometry = "*"
|
|
34
|
+
# kuva-metadata = "*"
|
|
35
35
|
|
|
36
36
|
# Temporarily can replace pypi version with relative dep if doing local development
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
[tool.poetry.dependencies.kuva-geometry]
|
|
38
|
+
path = "../kuva-geometry"
|
|
39
|
+
develop = true
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
[tool.poetry.dependencies.kuva-metadata]
|
|
42
|
+
path = "../kuva-metadata"
|
|
43
|
+
develop = true
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
[tool.ruff.lint]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|