Skip to content
Snippets Groups Projects
Commit 202d9baa authored by leufen1's avatar leufen1
Browse files

add log statement to track progress

parent 15dc6218
No related branches found
No related tags found
5 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!317enabled window_lead_time=1,!295Resolve "data handler FIR filter",!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #67238 passed
...@@ -260,9 +260,10 @@ class ClimateFIRFilter: ...@@ -260,9 +260,10 @@ class ClimateFIRFilter:
future = self._shift_data(apriori, range(1, length + 1), time_dim, var_dim, new_dim) future = self._shift_data(apriori, range(1, length + 1), time_dim, var_dim, new_dim)
filter_input_data = history.combine_first(future) filter_input_data = history.combine_first(future)
time_axis = filter_input_data.coords["datetime"]
# apply vectorized fir filter along the tmp dimension # apply vectorized fir filter along the tmp dimension
filt = xr.apply_ufunc(fir_filter_vectorized, filter_input_data, filt = xr.apply_ufunc(fir_filter_vectorized, filter_input_data, time_axis,
input_core_dims=[[new_dim]], output_core_dims=[[new_dim]], vectorize=True, input_core_dims=[[new_dim], []], output_core_dims=[[new_dim]], vectorize=True,
kwargs={"fs": fs, "cutoff_high": cutoff_high, "order": order, kwargs={"fs": fs, "cutoff_high": cutoff_high, "order": order,
"causal": False, "padlen": int(min(padlen_factor, 1) * length)}) "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 ...@@ -382,9 +383,13 @@ def fir_filter(data, fs, order=5, cutoff_low=None, cutoff_high=None, window="ham
return filtered, h 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): padlen=None):
"""Expects numpy array.""" """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) sel = ~np.isnan(data)
res = np.empty_like(data) res = np.empty_like(data)
if h is None: if h is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment