From 98107e2b29cf5af6846dc4e0010486dda25acf12 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Tue, 17 Oct 2023 12:43:09 +0200 Subject: [PATCH] use it in convolution --- Device/Resolution/ConvolutionDetectorResolution.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Device/Resolution/ConvolutionDetectorResolution.cpp b/Device/Resolution/ConvolutionDetectorResolution.cpp index 571e3a5981f..a8b69dcda46 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 -- GitLab