kuva-reader 0.1.1__tar.gz → 0.1.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.

Potentially problematic release.


This version of kuva-reader might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: kuva-reader
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Manipulate the Kuva Space image and metadata formats
5
5
  License: MIT
6
6
  Author: Guillem Ballesteros
@@ -11,6 +11,7 @@ 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
+ Classifier: Programming Language :: Python :: 3.13
14
15
  Requires-Dist: dask (>=2023.12.1,<2024.0.0)
15
16
  Requires-Dist: kuva-geometry
16
17
  Requires-Dist: kuva-metadata
@@ -205,7 +205,7 @@ class Level0Product(ProductBase[MetadataLevel0]):
205
205
  if camera is None:
206
206
  e_ = "The `camera` argument must be given for L0 product bad pixel masks."
207
207
  raise ValueError(e_)
208
- bad_pixel_filename = f"{camera}_per_frame_cloud_mask.tif"
208
+ bad_pixel_filename = f"{camera}_per_frame_bad_pixel_mask.tif"
209
209
  return self._read_array(self.image_path / bad_pixel_filename)
210
210
 
211
211
  def get_cloud_mask(self, camera: str | None = None) -> xarray.Dataset:
@@ -2,6 +2,7 @@ from pathlib import Path
2
2
  from typing import cast
3
3
 
4
4
  import rioxarray as rx
5
+ import xarray
5
6
  from kuva_metadata import MetadataLevel1AB, MetadataLevel1C
6
7
  from pint import UnitRegistry
7
8
  from xarray import Dataset
@@ -86,6 +87,26 @@ class Level1ABProduct(ProductBase[MetadataLevel1AB]):
86
87
 
87
88
  return metadata
88
89
 
90
+ def get_bad_pixel_mask(
91
+ self, camera: str | None = None, per_band: bool = False
92
+ ) -> xarray.Dataset:
93
+ """Get the bad pixel mask associated to each camera of the L0 product
94
+
95
+ Returns
96
+ -------
97
+ The bad pixel masks of the cameras
98
+ """
99
+ if camera is not None:
100
+ e_ = "Parameter `camera` is not supported in this product level."
101
+ raise ValueError(e_)
102
+
103
+ if per_band:
104
+ bad_pixel_filename = self.image_path / "bad_pixel_mask_per_band.tif"
105
+ else:
106
+ bad_pixel_filename = self.image_path / "bad_pixel_mask_aggregated.tif"
107
+
108
+ return self._read_array(self.image_path / bad_pixel_filename)
109
+
89
110
 
90
111
  class Level1CProduct(ProductBase[MetadataLevel1C]):
91
112
  """
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "kuva-reader"
7
- version = "0.1.1"
7
+ version = "0.1.3"
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
  license = "MIT"