kuva-reader 0.1.4__py3-none-any.whl → 1.0.1__py3-none-any.whl

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.

@@ -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
- return (
107
- f"{self.__class__.__name__}("
108
- f"len(self.images)={len(self.images)}, "
109
- f"self.images[0].shape={self.images[0].shape}"
110
- f"crs={self.images[0].rio.crs}, "
111
- f"image_path='{self.image_path}"
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."""
@@ -242,6 +243,7 @@ class Level0Product(ProductBase[MetadataLevel0]):
242
243
  del self.images
243
244
  self.images = None
244
245
 
246
+
245
247
  def generate_level_0_metafile():
246
248
  """Example function for reading a product and generating a metadata file from the
247
249
  sidecar metadata objects.
@@ -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
- return (
170
- f"{self.__class__.__name__}("
171
- f"image.shape={self.image.shape}, "
172
- f"image.crs={self.image.rio.crs}, "
173
- f"wavelengths={self.wavelengths}"
174
- f"image_path='{self.image_path})"
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
- return (
62
- f"{self.__class__.__name__}("
63
- f"image.shape={self.image.shape}, "
64
- f"image.crs={self.image.rio.crs}, "
65
- f"wavelengths={self.wavelengths}"
66
- f"image_path='{self.image_path})"
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kuva-reader
3
- Version: 0.1.4
3
+ Version: 1.0.1
4
4
  Summary: Manipulate the Kuva Space image and metadata formats
5
5
  License: MIT
6
6
  Author: Guillem Ballesteros
@@ -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
- l1c_product = read_product("my_data_folder/hyperfield1a_L2A_20250105T092548")
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](../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](../CODE_OF_CONDUCT.md) while discussing in the
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](../LICENSE.md).
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
 
@@ -2,14 +2,14 @@ kuva_reader/__init__.py,sha256=qqsgtVNCkqXFuXOXf5v51ZT_Dcipj1ty0mGUw8fU3sU,1509
2
2
  kuva_reader/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  kuva_reader/reader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  kuva_reader/reader/image.py,sha256=Ep54Tzila3hKF2I_u-54xnFUf8WqP2fiKAJnbyZxasA,4647
5
- kuva_reader/reader/level0.py,sha256=atehEeBnlHewRFaC0kuOGEwg7YaWnLaI9MR4OPiDveU,10233
6
- kuva_reader/reader/level1.py,sha256=iqTsetWpPZaiM9-CjeNdyXqJrODsKFPFqCyBGrlcNY0,7693
7
- kuva_reader/reader/level2.py,sha256=co6KOUI5PSPkGTqoKnZAxWFVsFRGOdE3PnQ5PDhmdnk,3969
5
+ kuva_reader/reader/level0.py,sha256=-ONYaBH9YFHGaFvJDiDRlmXUWTYPQyQt0XZeuv5sEL4,10370
6
+ kuva_reader/reader/level1.py,sha256=V1gNjz9y185nCJkYpQVcXrmAOQVMaFwIPeIhQJBzaI4,7815
7
+ kuva_reader/reader/level2.py,sha256=lyEbVSLkBxz32ZIEnJih4ln-F_d8h6FTOu1Npt7VHg0,4091
8
8
  kuva_reader/reader/product_base.py,sha256=_O96DACi2bWEXhNJVuIU328RJ1y1gs7_rMyyEaMo4aA,4294
9
9
  kuva_reader/reader/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  kuva_reader/reader/read.py,sha256=l2x-vlOLP8AUMzqSjHLaT7xt0YJtYUjiYWm6btV-rqo,1762
11
11
  kuva_reader/reader/utils.py,sha256=oZ1G43nm8lCxzfbdqBs0KhKaXWe_uf-78uBXWvmZigs,1566
12
- kuva_reader-0.1.4.dist-info/METADATA,sha256=YZzgW8DEPaLqKreWgz28uCguDBHpNpDQVXUOvGzFkMQ,4762
13
- kuva_reader-0.1.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
14
- kuva_reader-0.1.4.dist-info/entry_points.txt,sha256=YJysY9EChfOb1W_IEht2oE5Z8Y9jA0J6-kofaPv-NdI,149
15
- kuva_reader-0.1.4.dist-info/RECORD,,
12
+ kuva_reader-1.0.1.dist-info/METADATA,sha256=Ru0be5pkSdwlAvnrn1F8X8ZoxSm-Nhqflc_F6lXF-2k,4609
13
+ kuva_reader-1.0.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
14
+ kuva_reader-1.0.1.dist-info/entry_points.txt,sha256=YJysY9EChfOb1W_IEht2oE5Z8Y9jA0J6-kofaPv-NdI,149
15
+ kuva_reader-1.0.1.dist-info/RECORD,,