From 2e8faa6aba1aed386176ea06f01ca10cda0016e1 Mon Sep 17 00:00:00 2001
From: Daniel Scheffler <danschef@gfz-potsdam.de>
Date: Thu, 8 Feb 2024 21:31:05 +0100
Subject: [PATCH] Fix dimension bug.

Signed-off-by: Daniel Scheffler <danschef@gfz-potsdam.de>
---
 enpt/processors/orthorectification/orthorectification.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/enpt/processors/orthorectification/orthorectification.py b/enpt/processors/orthorectification/orthorectification.py
index a219ec8e..a43a042f 100644
--- a/enpt/processors/orthorectification/orthorectification.py
+++ b/enpt/processors/orthorectification/orthorectification.py
@@ -95,9 +95,9 @@ class Orthorectifier(object):
 
         lons_vnir, lats_vnir = enmap_ImageL1.vnir.detector_meta.lons, enmap_ImageL1.vnir.detector_meta.lats
         lons_swir, lats_swir = enmap_ImageL1.swir.detector_meta.lons, enmap_ImageL1.swir.detector_meta.lats
-        if not enmap_ImageL1.vnir.detector_meta.geolayer_has_keystone:
+        if not enmap_ImageL1.vnir.detector_meta.geolayer_has_keystone and lons_vnir.ndim == 3:
             lons_vnir, lats_vnir = lons_vnir[:, :, 0], lats_vnir[:, :, 0]
-        if not enmap_ImageL1.swir.detector_meta.geolayer_has_keystone:
+        if not enmap_ImageL1.swir.detector_meta.geolayer_has_keystone and lons_swir.ndim == 3:
             lons_swir, lats_swir = lons_swir[:, :, 0], lats_swir[:, :, 0]
 
         # get target EPSG code and common extent
-- 
GitLab