Skip to content
Snippets Groups Projects

Resolve "release v1.4.0"

Merged Ghost User requested to merge release_v1.4.0 into master
1 file
+ 8
3
Compare changes
  • Side-by-side
  • Inline
+ 8
3
@@ -260,9 +260,10 @@ class ClimateFIRFilter:
future = self._shift_data(apriori, range(1, length + 1), time_dim, var_dim, new_dim)
filter_input_data = history.combine_first(future)
time_axis = filter_input_data.coords["datetime"]
# apply vectorized fir filter along the tmp dimension
filt = xr.apply_ufunc(fir_filter_vectorized, filter_input_data,
input_core_dims=[[new_dim]], output_core_dims=[[new_dim]], vectorize=True,
filt = xr.apply_ufunc(fir_filter_vectorized, filter_input_data, time_axis,
input_core_dims=[[new_dim], []], output_core_dims=[[new_dim]], vectorize=True,
kwargs={"fs": fs, "cutoff_high": cutoff_high, "order": order,
"causal": False, "padlen": int(min(padlen_factor, 1) * length)})
@@ -382,9 +383,13 @@ def fir_filter(data, fs, order=5, cutoff_low=None, cutoff_high=None, window="ham
return filtered, h
def fir_filter_vectorized(data, fs, order=5, cutoff_low=None, cutoff_high=None, window="hamming", h=None, causal=True,
def fir_filter_vectorized(data, time_stamp, fs, order=5, cutoff_low=None, cutoff_high=None, window="hamming", h=None,
causal=True,
padlen=None):
"""Expects numpy array."""
pd_date = pd.to_datetime(time_stamp)
if pd_date.day == 1 and pd_date.month in [1, 7]:
logging.info(time_stamp)
sel = ~np.isnan(data)
res = np.empty_like(data)
if h is None:
Loading