Skip to content
Snippets Groups Projects
Commit 607fc803 authored by leufen1's avatar leufen1
Browse files

filter width for fir filter is now correct

parent ec34a136
No related branches found
No related tags found
6 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!317enabled window_lead_time=1,!297Resolve "BUG: data handler fails if no chem variable is used",!295Resolve "data handler FIR filter",!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #66460 failed
This commit is part of merge request !318. Comments created here will be created in the context of that merge request.
...@@ -194,13 +194,32 @@ class DataHandlerMixedSamplingWithFirFilterSingleStation(DataHandlerMixedSamplin ...@@ -194,13 +194,32 @@ class DataHandlerMixedSamplingWithFirFilterSingleStation(DataHandlerMixedSamplin
_requirements = list(set(_requirements1 + _requirements2)) _requirements = list(set(_requirements1 + _requirements2))
def estimate_filter_width(self): def estimate_filter_width(self):
""" """ """Filter width is determined by the filter with the highest order."""
return 5 # Todo: adjust this method return max(self.filter_order)
def _extract_lazy(self, lazy_data): def _extract_lazy(self, lazy_data):
_data, _meta, _input_data, _target_data, self.fir_coeff = lazy_data _data, _meta, _input_data, _target_data, self.fir_coeff = lazy_data
super(__class__, self)._extract_lazy((_data, _meta, _input_data, _target_data)) super(__class__, self)._extract_lazy((_data, _meta, _input_data, _target_data))
@staticmethod
def _get_fs(**kwargs):
"""Return frequency in 1/day (not Hz)"""
sampling = kwargs.get("sampling")[0]
if sampling == "daily":
return 1
elif sampling == "hourly":
return 24
else:
raise ValueError(f"Unknown sampling rate {sampling}. Only daily and hourly resolution is supported.")
class DataHandlerMixedSamplingWithFirFilter(DefaultDataHandler):
"""Data handler using mixed sampling for input and target. Inputs are temporal filtered."""
data_handler = DataHandlerMixedSamplingWithFirFilterSingleStation
data_handler_transformation = DataHandlerMixedSamplingWithFirFilterSingleStation
_requirements = data_handler.requirements()
class DataHandlerSeparationOfScalesSingleStation(DataHandlerMixedSamplingWithKzFilterSingleStation): class DataHandlerSeparationOfScalesSingleStation(DataHandlerMixedSamplingWithKzFilterSingleStation):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment