Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
98107e2b
Commit
98107e2b
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
use it in convolution
parent
e9cd4f47
No related branches found
No related tags found
1 merge request
!2025
provide Datafield::setVector2D, and use it in convolution
Pipeline
#115214
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Device/Resolution/ConvolutionDetectorResolution.cpp
+3
-8
3 additions, 8 deletions
Device/Resolution/ConvolutionDetectorResolution.cpp
with
3 additions
and
8 deletions
Device/Resolution/ConvolutionDetectorResolution.cpp
+
3
−
8
View file @
98107e2b
...
@@ -92,7 +92,7 @@ void ConvolutionDetectorResolution::apply1dConvolution(Datafield* df) const
...
@@ -92,7 +92,7 @@ void ConvolutionDetectorResolution::apply1dConvolution(Datafield* df) const
// Truncate negative values that can arise because of finite precision of Fourier Transform
// Truncate negative values that can arise because of finite precision of Fourier Transform
for
(
double
&
e
:
result
)
for
(
double
&
e
:
result
)
e
=
std
::
max
(
0.0
,
e
);
e
=
std
::
max
(
0.0
,
e
);
// Populate intensity map with results
df
->
setVector
(
result
);
df
->
setVector
(
result
);
}
}
...
@@ -124,17 +124,12 @@ void ConvolutionDetectorResolution::apply2dConvolution(Datafield* df) const
...
@@ -124,17 +124,12 @@ void ConvolutionDetectorResolution::apply2dConvolution(Datafield* df) const
}
}
kernel
[
ix
]
=
row_vector
;
kernel
[
ix
]
=
row_vector
;
}
}
// Calculate convolution
// Calculate convolution
std
::
vector
<
std
::
vector
<
double
>>
result
;
std
::
vector
<
std
::
vector
<
double
>>
result
;
Convolve
().
fftconvolve
(
df
->
values2D
(),
kernel
,
result
);
Convolve
().
fftconvolve
(
df
->
values2D
(),
kernel
,
result
);
// Populate intensity map with results
df
->
setVector2D
(
result
);
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
]);
}
}
}
double
ConvolutionDetectorResolution
::
getIntegratedPDF1d
(
double
x
,
double
step
)
const
double
ConvolutionDetectorResolution
::
getIntegratedPDF1d
(
double
x
,
double
step
)
const
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment