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
462da1ff
Commit
462da1ff
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
Offspec: intensity_map from class member to local
parent
53867f2b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1272
Consolidate simulation classes; don't wrap SpinMatrix in PolMatrices
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sim/Simulation/OffspecSimulation.cpp
+9
-8
9 additions, 8 deletions
Sim/Simulation/OffspecSimulation.cpp
Sim/Simulation/OffspecSimulation.h
+0
-1
0 additions, 1 deletion
Sim/Simulation/OffspecSimulation.h
with
9 additions
and
9 deletions
Sim/Simulation/OffspecSimulation.cpp
+
9
−
8
View file @
462da1ff
...
@@ -74,11 +74,6 @@ void OffspecSimulation::setBeamParameters(double wavelength, const IAxis& alpha_
...
@@ -74,11 +74,6 @@ void OffspecSimulation::setBeamParameters(double wavelength, const IAxis& alpha_
throw
std
::
runtime_error
(
"OffspecSimulation::prepareSimulation() "
throw
std
::
runtime_error
(
"OffspecSimulation::prepareSimulation() "
"-> Error. Incoming alpha range size < 1."
);
"-> Error. Incoming alpha range size < 1."
);
beam
()
=
InBeam
(
beam
().
intensity
(),
wavelength
,
alpha_axis
.
min
(),
phi_i
);
beam
()
=
InBeam
(
beam
().
intensity
(),
wavelength
,
alpha_axis
.
min
(),
phi_i
);
// update intensity map
ASSERT
(
m_alpha_i_axis
);
m_intensity_map
.
reset
(
new
Datafield
({
m_alpha_i_axis
->
clone
(),
m_detector
->
axis
(
1
).
clone
()}));
m_intensity_map
->
setAllTo
(
0.
);
}
}
const
IAxis
*
OffspecSimulation
::
beamAxis
()
const
const
IAxis
*
OffspecSimulation
::
beamAxis
()
const
...
@@ -205,9 +200,15 @@ SimulationResult OffspecSimulation::packResult() const
...
@@ -205,9 +200,15 @@ SimulationResult OffspecSimulation::packResult() const
for
(
size_t
i
=
0
;
i
<
m_eles
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
m_eles
.
size
();
i
++
)
m_eles
[
i
].
setIntensity
(
m_cache
[
i
]);
m_eles
[
i
].
setIntensity
(
m_cache
[
i
]);
// update intensity map
ASSERT
(
m_alpha_i_axis
);
std
::
unique_ptr
<
Datafield
>
intensity_map
;
intensity_map
.
reset
(
new
Datafield
({
m_alpha_i_axis
->
clone
(),
m_detector
->
axis
(
1
).
clone
()}));
intensity_map
->
setAllTo
(
0.
);
const
IAxis
&
phi_axis
=
m_detector
->
axis
(
0
);
const
IAxis
&
phi_axis
=
m_detector
->
axis
(
0
);
size_t
phi_f_size
=
phi_axis
.
size
();
size_t
phi_f_size
=
phi_axis
.
size
();
ASSERT
(
phi_f_size
*
m_
intensity_map
->
size
()
==
m_eles
.
size
());
ASSERT
(
phi_f_size
*
intensity_map
->
size
()
==
m_eles
.
size
());
// Normalize, apply detector resolution and transfer detector image corresponding to
// Normalize, apply detector resolution and transfer detector image corresponding to
// alpha_i = m_alpha_i_axis->bin(index)
// alpha_i = m_alpha_i_axis->bin(index)
...
@@ -221,10 +222,10 @@ SimulationResult OffspecSimulation::packResult() const
...
@@ -221,10 +222,10 @@ SimulationResult OffspecSimulation::packResult() const
m_detector
->
applyDetectorResolution
(
detector_image
.
get
());
m_detector
->
applyDetectorResolution
(
detector_image
.
get
());
size_t
y_axis_size
=
m_detector
->
axis
(
1
).
size
();
size_t
y_axis_size
=
m_detector
->
axis
(
1
).
size
();
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
(
*
m_
intensity_map
)[
j
*
y_axis_size
+
i
%
y_axis_size
]
+=
(
*
detector_image
)[
i
];
(
*
intensity_map
)[
j
*
y_axis_size
+
i
%
y_axis_size
]
+=
(
*
detector_image
)[
i
];
}
}
auto
data
=
std
::
unique_ptr
<
Datafield
>
(
m_
intensity_map
->
clone
());
auto
data
=
std
::
unique_ptr
<
Datafield
>
(
intensity_map
->
clone
());
std
::
unique_ptr
<
const
ICoordSystem
>
coordsSystem
(
simCoordSystem
());
std
::
unique_ptr
<
const
ICoordSystem
>
coordsSystem
(
simCoordSystem
());
return
{
*
data
,
*
coordsSystem
};
return
{
*
data
,
*
coordsSystem
};
}
}
...
...
This diff is collapsed.
Click to expand it.
Sim/Simulation/OffspecSimulation.h
+
0
−
1
View file @
462da1ff
...
@@ -108,7 +108,6 @@ private:
...
@@ -108,7 +108,6 @@ private:
std
::
vector
<
size_t
>
m_active_indices
;
//!< The sequence of bin indices (unmasked, in ROI)
std
::
vector
<
size_t
>
m_active_indices
;
//!< The sequence of bin indices (unmasked, in ROI)
OwningVector
<
const
IPixel
>
m_pixels
;
//!< All unmasked pixels inside ROI.
OwningVector
<
const
IPixel
>
m_pixels
;
//!< All unmasked pixels inside ROI.
std
::
unique_ptr
<
IAxis
>
m_alpha_i_axis
;
std
::
unique_ptr
<
IAxis
>
m_alpha_i_axis
;
std
::
unique_ptr
<
Datafield
>
m_intensity_map
;
#endif // SWIG
#endif // SWIG
};
};
...
...
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