From 87fa34981890a2906c46b21a0648678492c75987 Mon Sep 17 00:00:00 2001 From: thorbjoernl <51087536+thorbjoernl@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:51:28 +0100 Subject: [PATCH] Fix wrong file selected --- src/pyaro/timeseries/Filter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pyaro/timeseries/Filter.py b/src/pyaro/timeseries/Filter.py index 42398fe..c26a1c0 100644 --- a/src/pyaro/timeseries/Filter.py +++ b/src/pyaro/timeseries/Filter.py @@ -1304,12 +1304,14 @@ def _update_topo_file_path(self, lat: float, lon: float) -> bool: if lon < metadata[file]["w"] or lon > metadata[file]["e"]: continue + self._topo_file = self._topo / file + break + if file is None: raise Exception( f"No matching topography file found for coordinate pair (lat={lat:.6f}; lon={lon:.6f})" ) - self._topo_file = self._topo / file else: raise FileNotFoundError