Skip to content
Snippets Groups Projects
Commit 9d354aa3 authored by Ewan Barr's avatar Ewan Barr
Browse files

cleaned up and added flag to only call handler once the data is valid

parent ea50798a
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,6 @@ SimpleFFTSpectrometer<HandlerType>::SimpleFFTSpectrometer( ...@@ -22,7 +22,6 @@ SimpleFFTSpectrometer<HandlerType>::SimpleFFTSpectrometer(
, _nbits(nbits) , _nbits(nbits)
, _handler(handler) , _handler(handler)
, _fft_plan(0) , _fft_plan(0)
, _data_valid(true)
, _pass(0) , _pass(0)
{ {
BOOST_LOG_TRIVIAL(debug) BOOST_LOG_TRIVIAL(debug)
...@@ -154,7 +153,6 @@ bool SimpleFFTSpectrometer<HandlerType>::operator()(RawBytes& block) ...@@ -154,7 +153,6 @@ bool SimpleFFTSpectrometer<HandlerType>::operator()(RawBytes& block)
_detected_host_previous->size() * sizeof(float)); _detected_host_previous->size() * sizeof(float));
BOOST_LOG_TRIVIAL(debug) << "Calling handler"; BOOST_LOG_TRIVIAL(debug) << "Calling handler";
CUDA_ERROR_CHECK(cudaStreamSynchronize(_h2d_stream)); CUDA_ERROR_CHECK(cudaStreamSynchronize(_h2d_stream));
std::swap(_edd_raw_current, _edd_raw_previous); std::swap(_edd_raw_current, _edd_raw_previous);
......
...@@ -110,7 +110,7 @@ void detect_and_accumulate(float2* __restrict__ in, float* __restrict__ out, int ...@@ -110,7 +110,7 @@ void detect_and_accumulate(float2* __restrict__ in, float* __restrict__ out, int
float y = tmp.y * tmp.y; float y = tmp.y * tmp.y;
sum += x + y; sum += x + y;
} }
out[write_offset + chan_idx] = sum; out[write_offset + chan_idx] = sum / naccumulate;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment