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
fda70c1d
Commit
fda70c1d
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
rename methods/vars to their actual function; docu
parent
09299349
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!81
Refactorings no. 2 for the upcoming removing of "region of interest" (ROI)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/Fitting/SimDataPair.cpp
+7
-6
7 additions, 6 deletions
Core/Fitting/SimDataPair.cpp
with
7 additions
and
6 deletions
Core/Fitting/SimDataPair.cpp
+
7
−
6
View file @
fda70c1d
...
...
@@ -37,7 +37,7 @@ std::unique_ptr<OutputData<double>> initUserWeights(const OutputData<double>& sh
return
result
;
}
bool
detHas
SameDimensions
(
const
IDetector
&
detector
,
const
OutputData
<
double
>&
data
)
bool
have
SameDimensions
(
const
IDetector
&
detector
,
const
OutputData
<
double
>&
data
)
{
if
(
data
.
rank
()
!=
detector
.
dimension
())
return
false
;
...
...
@@ -55,16 +55,17 @@ bool detHasSameDimensions(const IDetector& detector, const OutputData<double>& d
SimulationResult
convertData
(
const
ISimulation
&
simulation
,
const
OutputData
<
double
>&
data
)
{
const
ICoordSystem
*
co
nver
te
r
=
simulation
.
createCoordSystem
();
auto
roi_data
=
co
nver
te
r
->
createOutputData
(
co
nver
te
r
->
defaultUnits
());
const
ICoordSystem
*
co
ordSys
te
m
=
simulation
.
createCoordSystem
();
auto
roi_data
=
co
ordSys
te
m
->
createOutputData
(
co
ordSys
te
m
->
defaultUnits
());
if
(
roi_data
->
hasSameDimensions
(
data
))
{
// data is already cropped to ROI
simulation
.
detector
().
iterateOverNonMaskedPoints
([
&
](
IDetector
::
const_iterator
it
)
{
(
*
roi_data
)[
it
.
roiIndex
()]
=
data
[
it
.
roiIndex
()];
});
}
else
if
(
detHasSameDimensions
(
simulation
.
detector
(),
data
))
{
// exp data has same shape as the detector, we have to put orig data to smaller roi map
}
else
if
(
haveSameDimensions
(
simulation
.
detector
(),
data
))
{
// experimental data has same shape as the detector, we have to put orig data to smaller roi
// map
simulation
.
detector
().
iterateOverNonMaskedPoints
([
&
](
IDetector
::
const_iterator
it
)
{
(
*
roi_data
)[
it
.
roiIndex
()]
=
data
[
it
.
detectorIndex
()];
});
...
...
@@ -72,7 +73,7 @@ SimulationResult convertData(const ISimulation& simulation, const OutputData<dou
throw
std
::
runtime_error
(
"FitObject::init_dataset: Detector and experimental data have different shape"
);
return
SimulationResult
(
*
roi_data
,
std
::
move
(
co
nver
te
r
));
return
SimulationResult
(
*
roi_data
,
std
::
move
(
co
ordSys
te
m
));
}
}
// namespace
...
...
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