Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
8bfdd1ec
Commit
8bfdd1ec
authored
8 years ago
by
Leal, Ricardo
Browse files
Options
Downloads
Patches
Plain Diff
Re #16540 subtract offset to flange_det_dist for back compatibility
parent
e65d0563
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/DataHandling/src/LoadSpice2D.cpp
+49
-15
49 additions, 15 deletions
Framework/DataHandling/src/LoadSpice2D.cpp
with
49 additions
and
15 deletions
Framework/DataHandling/src/LoadSpice2D.cpp
+
49
−
15
View file @
8bfdd1ec
...
@@ -497,29 +497,63 @@ void LoadSpice2D::setMetadataAsRunProperties(
...
@@ -497,29 +497,63 @@ void LoadSpice2D::setMetadataAsRunProperties(
/**
/**
* Calculates the detector distances and sets them as Run properties
* Calculates the detector distances and sets them as Run properties
* Here fog starts:
* Here fog starts:
*
Bio
SANS: distance = sample_det_dist + offset!
*
GP
SANS: distance = sample_det_dist + offset!
*
GP
SANS: distance = sample_det_dist + offset + sample_to_flange!
*
Bio
SANS: distance = sample_det_dist + offset + sample_to_flange!
* Mathieu is using sample_det_dist to move the detector later
* Mathieu is using sample_det_dist to move the detector later
* So I'll do the same (Ricardo)
* So I'll do the same (Ricardo)
* June 14th 2016:
* New changes:
* sample_det_dist is not available
* flange_det_dist is new = old sample_det_dist + offset
* offset is not used
* GPSANS: distance = flange_det_dist! (sample_to_flange is 0 for GPSANS)
* BioSANS: distance = flange_det_dist + sample_to_flange!
* For back compatibility I'm subracting the offset to flange_det_dist
* @return : sample_detector_distance
* @return : sample_detector_distance
*/
*/
double
double
LoadSpice2D
::
detectorDistance
(
std
::
map
<
std
::
string
,
std
::
string
>
&
metadata
)
{
LoadSpice2D
::
detectorDistance
(
std
::
map
<
std
::
string
,
std
::
string
>
&
metadata
)
{
// sample_detector_distances
double
sample_detector_distance
=
0
;
double
sample_detector_distance
=
0
;
from_string
<
double
>
(
sample_detector_distance
,
double
sample_detector_distance_offset
,
sample_si_window_distance
;
metadata
[
"Motor_Positions/sample_det_dist"
],
std
::
dec
);
sample_detector_distance
*=
1000.0
;
// check if it's the new format
addRunProperty
<
double
>
(
"sample-detector-distance"
,
sample_detector_distance
,
if
(
metadata
.
find
(
"Motor_Positions/sample_det_dist"
)
!=
metadata
.
end
())
{
"mm"
);
// Old Format
double
sample_detector_distance_offset
=
from_string
<
double
>
(
sample_detector_distance
,
addRunProperty
<
double
>
(
metadata
,
"Header/tank_internal_offset"
,
metadata
[
"Motor_Positions/sample_det_dist"
],
std
::
dec
);
"sample-detector-distance-offset"
,
"mm"
);
sample_detector_distance
*=
1000.0
;
addRunProperty
<
double
>
(
"sample-detector-distance"
,
sample_detector_distance
,
double
sample_si_window_distance
=
addRunProperty
<
double
>
(
"mm"
);
metadata
,
"Header/sample_to_flange"
,
"sample-si-window-distance"
,
"mm"
);
sample_detector_distance_offset
=
addRunProperty
<
double
>
(
metadata
,
"Header/tank_internal_offset"
,
"sample-detector-distance-offset"
,
"mm"
);
sample_si_window_distance
=
addRunProperty
<
double
>
(
metadata
,
"Header/sample_to_flange"
,
"sample-si-window-distance"
,
"mm"
);
}
else
{
// New format:
from_string
<
double
>
(
sample_detector_distance
,
metadata
[
"Motor_Positions/flange_det_dist"
],
std
::
dec
);
sample_detector_distance
*=
1000.0
;
sample_detector_distance_offset
=
addRunProperty
<
double
>
(
metadata
,
"Header/tank_internal_offset"
,
"sample-detector-distance-offset"
,
"mm"
);
sample_detector_distance
-=
sample_detector_distance_offset
;
addRunProperty
<
double
>
(
"sample-detector-distance"
,
sample_detector_distance
,
"mm"
);
sample_si_window_distance
=
addRunProperty
<
double
>
(
metadata
,
"Header/sample_to_flange"
,
"sample-si-window-distance"
,
"mm"
);
}
// sample_detector_distances
double
total_sample_detector_distance
=
sample_detector_distance
+
double
total_sample_detector_distance
=
sample_detector_distance
+
sample_detector_distance_offset
+
sample_detector_distance_offset
+
...
...
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