Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
58bc9ed5
Commit
58bc9ed5
authored
Aug 01, 2018
by
Lynch, Vickie
Browse files
Refs #22420 test range of predicted peaks
parent
d9126791
Changes
5
Hide whitespace changes
Inline
Side-by-side
Framework/Crystal/src/PredictSatellitePeaks.cpp
View file @
58bc9ed5
...
...
@@ -139,27 +139,25 @@ void PredictSatellitePeaks::exec() {
IPeak
&
peak0
=
Peaks
->
getPeak
(
0
);
std
::
vector
<
V3D
>
possibleHKLs
;
if
(
includePeaksInRange
)
{
const
double
dMin
=
getProperty
(
"MinDSpacing"
);
const
double
dMax
=
getProperty
(
"MaxDSpacing"
);
Geometry
::
HKLGenerator
gen
(
lattice
,
dMin
);
auto
dSpacingFilter
=
boost
::
make_shared
<
HKLFilterDRange
>
(
lattice
,
dMin
,
dMax
);
V3D
hkl
=
*
(
gen
.
begin
());
g_log
.
information
()
<<
"HKL range for d_min of "
<<
dMin
<<
" to d_max of "
<<
dMax
<<
" is from "
<<
hkl
<<
" to "
<<
hkl
*
-
1.0
<<
", a total of "
<<
gen
.
size
()
<<
" possible HKL's
\n
"
;
if
(
gen
.
size
()
>
MAX_NUMBER_HKLS
)
throw
std
::
invalid_argument
(
"More than 10 billion HKLs to search. Is "
"your d_min value too small?"
);
possibleHKLs
.
clear
();
possibleHKLs
.
reserve
(
gen
.
size
());
std
::
remove_copy_if
(
gen
.
begin
(),
gen
.
end
(),
std
::
back_inserter
(
possibleHKLs
),
(
~
dSpacingFilter
)
->
fn
());
}
const
double
dMin
=
getProperty
(
"MinDSpacing"
);
const
double
dMax
=
getProperty
(
"MaxDSpacing"
);
Geometry
::
HKLGenerator
gen
(
lattice
,
dMin
);
auto
dSpacingFilter
=
boost
::
make_shared
<
HKLFilterDRange
>
(
lattice
,
dMin
,
dMax
);
V3D
hkl
=
*
(
gen
.
begin
());
g_log
.
information
()
<<
"HKL range for d_min of "
<<
dMin
<<
" to d_max of "
<<
dMax
<<
" is from "
<<
hkl
<<
" to "
<<
hkl
*
-
1.0
<<
", a total of "
<<
gen
.
size
()
<<
" possible HKL's
\n
"
;
if
(
gen
.
size
()
>
MAX_NUMBER_HKLS
)
throw
std
::
invalid_argument
(
"More than 10 billion HKLs to search. Is "
"your d_min value too small?"
);
possibleHKLs
.
clear
();
possibleHKLs
.
reserve
(
gen
.
size
());
std
::
remove_copy_if
(
gen
.
begin
(),
gen
.
end
(),
std
::
back_inserter
(
possibleHKLs
),
(
~
dSpacingFilter
)
->
fn
());
size_t
N
=
possibleHKLs
.
size
();
N
=
max
<
size_t
>
(
100
,
N
);
...
...
@@ -272,8 +270,8 @@ void PredictSatellitePeaks::predictOffsets(
Kernel
::
V3D
Qs
=
goniometer
*
UB
*
satelliteHKL
*
2.0
*
M_PI
;
// Check if Q is non-physical
if
(
Qs
[
2
]
<=
0
)
continue
;
if
(
Qs
[
2
]
<=
0
)
continue
;
auto
peak
(
Peaks
->
createPeak
(
Qs
,
1
));
...
...
Framework/Crystal/test/PredictSatellitePeaksTest.h
View file @
58bc9ed5
...
...
@@ -85,6 +85,7 @@ public:
TS_ASSERT
(
alg
.
isExecuted
());
alg
.
setPropertyValue
(
"SatellitePeaks"
,
"SatellitePeaks"
);
PeaksWorkspace_sptr
SatellitePeaks
=
alg
.
getProperty
(
"SatellitePeaks"
);
TS_ASSERT
(
SatellitePeaks
);
TS_ASSERT_EQUALS
(
SatellitePeaks
->
getNumberPeaks
(),
5
);
...
...
@@ -98,7 +99,7 @@ public:
TS_ASSERT_DELTA
(
peak3
.
getK
(),
0.0
,
.0001
);
TS_ASSERT_DELTA
(
peak3
.
getL
(),
0.2
,
.0001
);
/*
PredictSatellitePeaks alg4;
PredictSatellitePeaks
alg4
;
TS_ASSERT_THROWS_NOTHING
(
alg4
.
initialize
());
TS_ASSERT
(
alg4
.
isInitialized
());
...
...
@@ -114,9 +115,11 @@ public:
alg4
.
setProperty
(
"WavelengthMax"
,
"22"
);
TS_ASSERT
(
alg4
.
execute
())
TS_ASSERT
(
alg4
.
isExecuted
());
alg4
.
setPropertyValue
(
"SatellitePeaks"
,
"SatellitePeaks"
);
PeaksWorkspace_sptr
SatellitePeaks2
=
alg4
.
getProperty
(
"SatellitePeaks"
);
TS_ASSERT
(
SatellitePeaks2
);
TS_ASSERT_EQUALS(SatellitePeaks2->getNumberPeaks(),
5);*/
TS_ASSERT_EQUALS
(
SatellitePeaks2
->
getNumberPeaks
(),
467
);
AnalysisDataService
::
Instance
().
remove
(
WSName
);
}
...
...
Framework/DataObjects/inc/MantidDataObjects/PeakColumn.h
View file @
58bc9ed5
...
...
@@ -39,8 +39,6 @@ public:
/// Prints
void
print
(
size_t
index
,
std
::
ostream
&
s
)
const
override
;
void
eraseSubStr
(
std
::
string
&
str
,
const
std
::
string
&
toErase
);
void
read
(
size_t
index
,
const
std
::
string
&
text
)
override
;
/// Sets item from a stream
...
...
Framework/DataObjects/src/PeakColumn.cpp
View file @
58bc9ed5
...
...
@@ -173,7 +173,6 @@ void PeakColumn::read(size_t index, const std::string &text) {
// Convert to a double
double
val
=
0
;
int
success
=
Strings
::
convert
(
text
,
val
);
if
(
success
==
0
)
{
...
...
Framework/DataObjects/test/PeakColumnTest.h
View file @
58bc9ed5
...
...
@@ -119,7 +119,7 @@ public:
void
test_read_locale_awerness
()
{
const
std
::
vector
<
std
::
string
>
columnNames
{
"h"
,
"k"
,
"l"
,
"RunNumber"
};
const
std
::
vector
<
double
>
columnValues
{
-
2.0
,
5.0
,
12.0
,
14329
0.0
};
const
std
::
vector
<
double
>
columnValues
{
-
2.0
,
5.0
,
12.0
,
0.0
};
TestingNumpunctFacet
numpunct
;
const
std
::
locale
testLocale
(
std
::
locale
::
classic
(),
&
numpunct
);
for
(
size_t
i
=
0
;
i
<
columnNames
.
size
();
++
i
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment