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
a616eec7
Commit
a616eec7
authored
8 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Patches
Plain Diff
getDetectorIntensity is moved on board of IDetector2D for the following ROI handling
parent
854fa075
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Core/Instrument/IDetector2D.cpp
+21
-0
21 additions, 0 deletions
Core/Instrument/IDetector2D.cpp
Core/Instrument/IDetector2D.h
+6
-0
6 additions, 0 deletions
Core/Instrument/IDetector2D.h
Core/Instrument/Instrument.cpp
+1
-13
1 addition, 13 deletions
Core/Instrument/Instrument.cpp
with
28 additions
and
13 deletions
Core/Instrument/IDetector2D.cpp
+
21
−
0
View file @
a616eec7
...
...
@@ -113,6 +113,27 @@ std::string IDetector2D::addParametersToExternalPool(
return
new_path
;
}
OutputData
<
double
>
*
IDetector2D
::
getDetectorIntensity
(
const
OutputData
<
double
>
&
data
,
const
Beam
&
beam
,
IDetector2D
::
EAxesUnits
units_type
)
const
{
std
::
unique_ptr
<
OutputData
<
double
>
>
result
(
data
.
clone
());
applyDetectorResolution
(
result
.
get
());
if
(
units_type
==
IDetector2D
::
DEFAULT
)
{
return
result
.
release
();
}
OutputData
<
double
>*
detectorMap
=
createDetectorMap
(
beam
,
units_type
);
if
(
!
detectorMap
)
throw
Exceptions
::
RuntimeErrorException
(
"Instrument::getDetectorIntensity() -> Error."
"Can't create detector map."
);
detectorMap
->
setRawDataVector
(
result
->
getRawDataVector
());
return
detectorMap
;
}
OutputData
<
double
>*
IDetector2D
::
createDetectorMap
(
const
Beam
&
beam
,
EAxesUnits
units
)
const
{
std
::
unique_ptr
<
OutputData
<
double
>>
result
(
new
OutputData
<
double
>
);
...
...
This diff is collapsed.
Click to expand it.
Core/Instrument/IDetector2D.h
+
6
−
0
View file @
a616eec7
...
...
@@ -127,6 +127,12 @@ public:
virtual
std
::
string
addParametersToExternalPool
(
const
std
::
string
&
path
,
ParameterPool
*
external_pool
,
int
copy_number
=
-
1
)
const
;
//! Returns clone of the intensity map with detector resolution applied,
//! axes of map will be in requested units
OutputData
<
double
>*
getDetectorIntensity
(
const
OutputData
<
double
>&
data
,
const
Beam
&
beam
,
IDetector2D
::
EAxesUnits
units_type
=
IDetector2D
::
DEFAULT
)
const
;
//! Returns detector map in given axes units
virtual
OutputData
<
double
>*
createDetectorMap
(
const
Beam
&
beam
,
EAxesUnits
units
)
const
;
...
...
This diff is collapsed.
Click to expand it.
Core/Instrument/Instrument.cpp
+
1
−
13
View file @
a616eec7
...
...
@@ -122,19 +122,7 @@ void Instrument::applyDetectorResolution(OutputData<double>* p_intensity_map) co
OutputData
<
double
>*
Instrument
::
getDetectorIntensity
(
const
OutputData
<
double
>
&
data
,
IDetector2D
::
EAxesUnits
units_type
)
const
{
std
::
unique_ptr
<
OutputData
<
double
>
>
result
(
data
.
clone
());
applyDetectorResolution
(
result
.
get
());
if
(
units_type
==
IDetector2D
::
DEFAULT
)
{
return
result
.
release
();
}
else
{
OutputData
<
double
>*
detectorMap
=
mP_detector
->
createDetectorMap
(
m_beam
,
units_type
);
if
(
!
detectorMap
)
throw
Exceptions
::
RuntimeErrorException
(
"Instrument::getDetectorIntensity() -> Error."
"Can't create detector map."
);
detectorMap
->
setRawDataVector
(
result
->
getRawDataVector
());
return
detectorMap
;
}
return
mP_detector
->
getDetectorIntensity
(
data
,
m_beam
,
units_type
);
}
void
Instrument
::
print
(
std
::
ostream
&
ostr
)
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