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
66c4084e
Commit
66c4084e
authored
Jan 17, 2018
by
Samuel Jackson
Browse files
Add get goniometer matrix method
parent
4e5e0af2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp
View file @
66c4084e
#include
"MantidGeometry/Crystal/IPeak.h"
#include
"MantidPythonInterface/kernel/Converters/PyObjectToMatrix.h"
#include
"MantidPythonInterface/kernel/Converters/CloneToNumpy.h"
#include
"MantidPythonInterface/kernel/Policies/MatrixToNumpy.h"
#include
"MantidPythonInterface/kernel/GetPointer.h"
#include
<boost/optional.hpp>
#include
<boost/python/class.hpp>
#include
<boost/python/register_ptr_to_python.hpp>
using
Mantid
::
Geometry
::
IPeak
;
using
namespace
Mantid
::
PythonInterface
;
using
namespace
boost
::
python
;
GET_POINTER_SPECIALIZATION
(
IPeak
)
...
...
@@ -40,9 +43,14 @@ void setQSampleFrame2(IPeak &peak, Mantid::Kernel::V3D qSampleFrame,
void
setGoniometerMatrix
(
IPeak
&
self
,
const
object
&
data
)
{
self
.
setGoniometerMatrix
(
Converters
::
PyObjectToMatrix
(
data
)());
}
}
// namespace
void
export_IPeak
()
{
// return_value_policy for read-only numpy array
typedef
return_value_policy
<
Policies
::
MatrixToNumpy
>
return_copy_to_numpy
;
register_ptr_to_python
<
IPeak
*>
();
class_
<
IPeak
,
boost
::
noncopyable
>
(
"IPeak"
,
no_init
)
...
...
@@ -152,9 +160,13 @@ void export_IPeak() {
"Return the # of counts in the bin at its peak"
)
.
def
(
"setBinCount"
,
&
IPeak
::
setBinCount
,
(
arg
(
"self"
),
arg
(
"bin_count"
)),
"Set the # of counts in the bin at its peak"
)
.
def
(
"getGoniometerMatrix"
,
&
IPeak
::
getGoniometerMatrix
,
arg
(
"self"
),
return_copy_to_numpy
(),
"Get the :class:`~mantid.geometry.Goniometer` rotation matrix of this peak."
"
\n\n
.. versionadded:: 3.12.0"
)
.
def
(
"setGoniometerMatrix"
,
&
setGoniometerMatrix
,
(
arg
(
"self"
),
arg
(
"goniometerMatrix"
)),
"Set the :class:`~mantid.geometry.Goniometer` of th
e
peak"
)
"Set the :class:`~mantid.geometry.Goniometer`
rotation matrix
of th
is
peak
.
"
)
.
def
(
"getRow"
,
&
IPeak
::
getRow
,
arg
(
"self"
),
"For :class:`~mantid.geometry.RectangularDetector` s only, returns "
"the row (y) of the pixel of the "
...
...
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