Commit 34463b00 authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

Bugfix in filtering data with different filter windows

- Filter was also applied when no appropriate filter available
parent 3e424b19
......@@ -354,10 +354,14 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in,
try {
filter1_win = &filter1_wins.at(tofilter1.size());
// Filter data
filter_data_temp->filter_fir_sym(&tofilter1, filter1_win);
} catch (const std::out_of_range &oor) {
// if we get here, it means we don't have enough data to filter. A block probably got shortened.
// In this case, set data value to NaN
filter_data_temp->set_values_MD();
std::cerr << "Set values to MD!"
<< std::endl;
filter_data_temp->median_time(&tofilter1);
timestamp=filter_data_temp->get_time
("%Y-%m-%d %H:%M:%S",true);
......@@ -367,9 +371,6 @@ int Filter_Obs::lowpass_PLASMON_1Hz(buffer_obs* buffer_in,
<< std::endl;
}
// Filter data
filter_data_temp->filter_fir_sym(&tofilter1, filter1_win);
//std::string tmp_str;
//filter_data_temp->string(&tmp_str,5);
//std::cerr << "DEBUG ADD FILTER2: " << tmp_str << std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment