From 92bd426729ad66225cff57f3eac35ba472c6edd4 Mon Sep 17 00:00:00 2001
From: leufen1 <l.leufen@fz-juelich.de>
Date: Fri, 14 Jan 2022 11:52:53 +0100
Subject: [PATCH] removed hard coded window dim

---
 mlair/helpers/filter.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlair/helpers/filter.py b/mlair/helpers/filter.py
index 03065402..6c4247f3 100644
--- a/mlair/helpers/filter.py
+++ b/mlair/helpers/filter.py
@@ -586,8 +586,8 @@ class ClimateFIRFilter(FIRFilter):
                                                        new_dim).sel({time_dim: t0})
                 else:
                     tmp_filter_data = None
-                valid_start = int(filtered.window.min()) + int((len(h) + 1) / 2)
-                valid_end = min(extend_length_opts + offset + 1, int(filtered.window.max()) - int((len(h) + 1) / 2))
+                valid_start = int(filtered[new_dim].min()) + int((len(h) + 1) / 2)
+                valid_end = min(extend_length_opts + offset + 1, int(filtered[new_dim].max()) - int((len(h) + 1) / 2))
                 valid_range = range(valid_start, valid_end)
                 plot_data.append({"t0": t0,
                                   "var": variable_name,
-- 
GitLab