diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 11b3fea..e8a1899 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Changelog ========= +[1.4.3] (2022-09-19) +--------------------- +Fixed +^^^^^ +- Fixed bug in bandorder dn2toa + [1.4.2] (2022-09-19) --------------------- Changed diff --git a/ukis_pysat/__init__.py b/ukis_pysat/__init__.py index c902d56..5bf71d1 100644 --- a/ukis_pysat/__init__.py +++ b/ukis_pysat/__init__.py @@ -1 +1 @@ -__version__ = "1.4.2" +__version__ = "1.4.3" diff --git a/ukis_pysat/raster.py b/ukis_pysat/raster.py index 1bc6b51..fa139bd 100644 --- a/ukis_pysat/raster.py +++ b/ukis_pysat/raster.py @@ -346,14 +346,14 @@ def dn2toa(self, platform, mtl_file=None, mtd_file=None, wavelengths=None): if pb_baseline >= 4.0: radio_offsets = product_image_characteristics["Radiometric_Offset_List"]["RADIO_ADD_OFFSET"] - for b in self._lookup_bands(platform=Platform.Sentinel2, wavelengths=wavelengths): + for idx, b in enumerate(self._lookup_bands(platform=Platform.Sentinel2, wavelengths=wavelengths)): radio_offset = float([i for i in radio_offsets if i["@band_id"] == b][0]["#text"]) # rescale reflectance bands - toa.append((self.__arr[int(b), :, :].astype(np.float32) + radio_offset) / quantification_value) + toa.append((self.__arr[idx, :, :].astype(np.float32) + radio_offset) / quantification_value) else: - for b in self._lookup_bands(platform=Platform.Sentinel2, wavelengths=wavelengths): - toa.append(self.__arr[int(b), :, :].astype(np.float32) / quantification_value) + for idx, _ in enumerate(self._lookup_bands(platform=Platform.Sentinel2, wavelengths=wavelengths)): + toa.append(self.__arr[idx, :, :].astype(np.float32) / quantification_value) self.__arr = np.array(np.stack(toa, axis=0)) else: