diff --git a/Device/Resolution/ConvolutionDetectorResolution.cpp b/Device/Resolution/ConvolutionDetectorResolution.cpp index 571e3a5981fe17af1a01a65c4c2a18b29e5e5c55..a8b69dcda46731fdb9327d4e9c53a5560529a352 100644 --- a/Device/Resolution/ConvolutionDetectorResolution.cpp +++ b/Device/Resolution/ConvolutionDetectorResolution.cpp @@ -92,7 +92,7 @@ void ConvolutionDetectorResolution::apply1dConvolution(Datafield* df) const // Truncate negative values that can arise because of finite precision of Fourier Transform for (double& e : result) e = std::max(0.0, e); - // Populate intensity map with results + df->setVector(result); } @@ -124,17 +124,12 @@ void ConvolutionDetectorResolution::apply2dConvolution(Datafield* df) const } kernel[ix] = row_vector; } + // Calculate convolution std::vector<std::vector<double>> result; Convolve().fftconvolve(df->values2D(), kernel, result); - // Populate intensity map with results - ASSERT(nx * ny == df->size()); - for (size_t i = 0; i < df->size(); ++i) { - size_t i0 = df->frame().projectedIndex(i, 0); - size_t i1 = df->frame().projectedIndex(i, 1); - (*df)[i] = std::max(0.0, result[i0][i1]); - } + df->setVector2D(result); } double ConvolutionDetectorResolution::getIntegratedPDF1d(double x, double step) const