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
3fb4f730
Commit
3fb4f730
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ctd
parent
8b0a2487
No related branches found
No related tags found
1 merge request
!2026
simplify OffspecSim::packResult
Pipeline
#115222
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sim/Simulation/OffspecSimulation.cpp
+8
-12
8 additions, 12 deletions
Sim/Simulation/OffspecSimulation.cpp
with
8 additions
and
12 deletions
Sim/Simulation/OffspecSimulation.cpp
+
8
−
12
View file @
3fb4f730
...
...
@@ -132,27 +132,23 @@ size_t OffspecSimulation::nElements() const
Datafield
OffspecSimulation
::
packResult
()
{
// update intensity map
Datafield
intensity_map
({
m_scan
->
coordinateAxis
()
->
clone
(),
m_detector
->
axis
(
1
).
clone
()});
intensity_map
.
setAllTo
(
0.
);
const
size_t
ns
=
m_scan
->
nScan
();
const
size_t
ny
=
m_detector
->
axis
(
1
).
size
();
const
size_t
Ndet
=
m_detector
->
axis
(
0
).
size
()
*
ny
;
std
::
vector
<
double
>
out
(
ns
*
ny
,
0.
);
// Apply detector resolution and transfer detector image
for
(
size_t
j
=
0
;
j
<
ns
;
++
j
)
{
// TODO restore resolution m_detector->applyDetectorResolution(&detector_image);
for
(
size_t
i
=
0
;
i
<
Ndet
;
++
i
)
intensity_map
[
j
*
ny
+
i
%
ny
]
+=
m_cache
[
j
*
Ndet
+
i
];
if
(
background
())
for
(
size_t
i
=
0
;
i
<
Ndet
;
++
i
)
intensity_map
[
j
*
ny
+
i
%
ny
]
=
background
()
->
addBackground
(
intensity_map
[
j
*
ny
+
i
%
ny
]);
for
(
size_t
i
=
0
;
i
<
Ndet
;
++
i
)
{
double
&
val
=
out
[
j
*
ny
+
i
%
ny
];
val
+=
m_cache
[
j
*
Ndet
+
i
];
if
(
background
())
val
=
background
()
->
addBackground
(
val
);
}
}
return
{
inte
nsity_map
};
return
{
{
m_scan
->
coord
in
a
te
Axis
()
->
clone
(),
m_detector
->
axis
(
1
).
clone
()},
out
};
}
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