Skip to content
Snippets Groups Projects

Lukas issue339 feat filter with future mix

Merged Ghost User requested to merge lukas_issue339_feat_filter-with-future-mix into develop
2 files
+ 7
7
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 5
5
@@ -19,7 +19,7 @@ from mlair.helpers import to_list, TimeTrackingWrapper, TimeTracking
class FIRFilter:
from mlair.plotting.data_insight_plotting import PlotFirFilter
def __init__(self, data, fs, order, cutoff, window, var_dim, time_dim, station_name=None, minimum_length=0, offset=0, plot_path=None):
def __init__(self, data, fs, order, cutoff, window, var_dim, time_dim, station_name=None, minimum_length=None, offset=0, plot_path=None):
self._filtered = []
self._h = []
self.data = data
@@ -76,6 +76,7 @@ class FIRFilter:
def create_visualization(self, filtered, filter_input_data, plot_dates, time_dim, sampling,
h, minimum_length, order, i, offset, var_dim): # pragma: no cover
plot_data = []
minimum_length = minimum_length or 0
for viz_date in set(plot_dates).intersection(filtered.coords[time_dim].values):
try:
if i < len(order) - 1:
@@ -196,12 +197,11 @@ class ClimateFIRFilter(FIRFilter):
self.apriori_diurnal = apriori_diurnal
self._apriori_list = []
self.sel_opts = sel_opts
self.minimum_length = minimum_length
self.new_dim = new_dim
self.plot_path = plot_path
self.plot_data = []
self.extend_length_opts = extend_length_opts
super().__init__(data, fs, order, cutoff, window, var_dim, time_dim, station_name=station_name)
super().__init__(data, fs, order, cutoff, window, var_dim, time_dim, station_name=station_name,
minimum_length=minimum_length, plot_path=plot_path)
def run(self):
filtered = []
@@ -742,7 +742,7 @@ class ClimateFIRFilter(FIRFilter):
# visualization
plot_data.extend(self.create_visualization(filt, d, filter_input_data, plot_dates, time_dim, new_dim,
sampling, extend_length_history, extend_length_future,
minimum_length, h, var, extend_length_opts))
minimum_length, h, var, extend_opts_var))
# collect all filter results
coll.append(xr.concat(filt_coll, time_dim))
Loading