Skip to content
Snippets Groups Projects
Commit 1215576e authored by leufen1's avatar leufen1
Browse files

add exception if filter input plot wasn't successful

parent 1892f3cb
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 #67270 passed
......@@ -274,11 +274,15 @@ class ClimateFIRFilter:
# plot
if self.plot_path is not None:
pos = 720
filter_example = filter_input_data.isel({time_dim: pos})
t0 = filter_example.coords[time_dim].values
t_slice = filter_input_data.isel({time_dim: slice(pos - length, pos + length + 1)}).coords[time_dim].values
self.plot(data, filter_example, var_dim, time_dim, t_slice, t0, plot_index)
try:
pos = 720
filter_example = filter_input_data.isel({time_dim: pos})
t0 = filter_example.coords[time_dim].values
t_slice = filter_input_data.isel({time_dim: slice(pos - length, pos + length + 1)}).coords[
time_dim].values
self.plot(data, filter_example, var_dim, time_dim, t_slice, t0, plot_index)
except IndexError:
pass
# select only values at tmp dimension 0 at each point in time
return filt.sel({new_dim: 0}, drop=True), h, apriori
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment