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
22010426
Commit
22010426
authored
5 years ago
by
Harriet Brown
Browse files
Options
Downloads
Patches
Plain Diff
correct eps term in placzek correction
parent
0b199566
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
+4
-5
4 additions, 5 deletions
Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
+5
-6
5 additions, 6 deletions
.../Diffraction/isis_powder/polaris_routines/polaris_algs.py
with
9 additions
and
11 deletions
Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
+
4
−
5
View file @
22010426
...
...
@@ -114,10 +114,10 @@ void CalculatePlaczekSelfScattering::exec() {
phi1
.
push_back
((
xLambda
[
i
]
+
dx
)
*
incidentPrime
[
i
]
/
incident
[
i
]);
}
// set detector law term (eps1)
const
double
lambdaD
=
1.44
;
std
::
vector
<
double
>
eps1
;
const
double
lambdaD
=
1.44
;
for
(
size_t
i
=
0
;
i
<
xLambda
.
size
()
-
1
;
i
++
)
{
double
xTerm
=
-
(
xLambda
[
i
]
+
dx
)
/
lambdaD
;
double
xTerm
=
(
xLambda
[
i
]
+
dx
)
/
lambdaD
;
eps1
.
push_back
(
xTerm
*
exp
(
xTerm
)
/
(
1.0
-
exp
(
xTerm
)));
}
/* Placzek
...
...
@@ -163,10 +163,9 @@ void CalculatePlaczekSelfScattering::exec() {
specInfo
.
twoTheta
(
specIndex
),
0
,
1.0
,
1.0
);
for
(
size_t
xIndex
=
0
;
xIndex
<
xLambda
.
size
()
-
1
;
xIndex
++
)
{
const
double
term1
=
(
f
-
1.0
)
*
phi1
[
xIndex
];
const
double
term2
=
-
f
*
eps1
[
xIndex
];
const
double
term3
=
f
-
3.0
;
const
double
term2
=
f
*
(
1.0
-
eps1
[
xIndex
]);
const
double
inelasticPlaczekSelfCorrection
=
2.0
*
(
term1
+
term2
+
term
3
)
*
sinThetaBy2
*
sinThetaBy2
*
2.0
*
(
term1
+
term2
-
3
)
*
sinThetaBy2
*
sinThetaBy2
*
summationTerm
;
x
[
xIndex
]
=
wavelength
.
singleToTOF
(
xLambda
[
xIndex
]);
y
[
xIndex
]
=
inelasticPlaczekSelfCorrection
;
...
...
This diff is collapsed.
Click to expand it.
scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
+
5
−
6
View file @
22010426
...
...
@@ -151,8 +151,8 @@ def _generate_grouped_ts_pdf(run_number, focused_ws, q_lims, cal_file_name, samp
width_x
=
(
max_x
-
min_x
)
/
x_data
.
size
fit_spectra
=
mantid
.
FitIncidentSpectrum
(
InputWorkspace
=
monitor
,
BinningForCalc
=
[
min_x
,
1
*
width_x
,
max_x
],
BinningForFit
=
[
min_x
,
50
*
width_x
,
max_x
],
FitSpectrumWith
=
"
GaussConv
CubicSpline
"
)
BinningForFit
=
[
min_x
,
1
*
width_x
,
max_x
],
FitSpectrumWith
=
"
CubicSpline
"
)
placzek
=
mantid
.
CalculatePlaczekSelfScattering
(
InputWorkspace
=
raw_ws
,
IncidentSpecta
=
fit_spectra
)
mantid
.
ConvertFromDistribution
(
Workspace
=
placzek
)
cal_workspace
=
mantid
.
LoadCalFile
(
InputWorkspace
=
placzek
,
...
...
@@ -174,10 +174,6 @@ def _generate_grouped_ts_pdf(run_number, focused_ws, q_lims, cal_file_name, samp
mantid
.
Subtract
(
LHSWorkspace
=
focused_data_combined
,
RHSWorkspace
=
placzek
,
OutputWorkspace
=
focused_data_combined
)
mantid
.
MatchSpectra
(
InputWorkspace
=
focused_data_combined
,
OutputWorkspace
=
focused_data_combined
,
ReferenceSpectrum
=
1
)
if
type
(
q_lims
)
==
str
:
q_min
=
[]
q_max
=
[]
...
...
@@ -202,6 +198,9 @@ def _generate_grouped_ts_pdf(run_number, focused_ws, q_lims, cal_file_name, samp
q_max
[
i
]
=
pdf_x_array
[
np
.
amax
(
np
.
where
(
pdf_x_array
<=
q_max
[
i
]))]
bin_width
=
min
(
pdf_x_array
[
1
]
-
pdf_x_array
[
0
],
bin_width
)
focused_data_combined
=
mantid
.
CropWorkspaceRagged
(
InputWorkspace
=
focused_data_combined
,
XMin
=
q_min
,
XMax
=
q_max
)
mantid
.
MatchSpectra
(
InputWorkspace
=
focused_data_combined
,
OutputWorkspace
=
focused_data_combined
,
ReferenceSpectrum
=
1
)
focused_data_combined
=
mantid
.
Rebin
(
InputWorkspace
=
focused_data_combined
,
Params
=
[
min
(
q_min
),
bin_width
,
max
(
q_max
)])
focused_data_combined
=
mantid
.
SumSpectra
(
InputWorkspace
=
focused_data_combined
,
...
...
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