Skip to content
Snippets Groups Projects
Commit a510fce6 authored by Bhuvan Bezawada's avatar Bhuvan Bezawada
Browse files

Small changes to rst file

re #22885
parent 69f489cf
No related branches found
No related tags found
No related merge requests found
......@@ -7,21 +7,28 @@ This is a python binding to the C++ class Mantid::Geometry::DetectorInfo.
--------
Purpose
--------
The purpose of the DetectorInfo object is to allow the user to access information about the detector(s) being used in an experiment. The DetectorInfo object can be used to access geometric information such as the number of detectors in the beamline, the absolute position of a detector as well as the absolute rotation of a detector.
The purpose of the ``DetectorInfo`` object is to allow the user to access information about the detector(s) being used in an experiment. The ``DetectorInfo`` object can be used to access geometric information such as the number of detectors in the beamline, the absolute position of a detector as well as the absolute rotation of a detector.
Many users may need this extra information so that they can have a better understanding of the beamline they are using. This extra information is also easy and fast to access meaning the users can make improvements to their experimental design with ease.
Many users may need this extra information so that they can have a better understanding of the beamline they are using. This information is easy and fast to access. Some information like mask flags can be modified directly.
DetectorInfo is one of three objects that the user can gain access to from a Workspace.
The ``DetectorInfo`` object is one of three objects that the user can gain access to from a workspace.
The other two are:
* SpectrumInfo
* ComponentInfo
* ``SpectrumInfo``
* ``ComponentInfo``
---------
Indexing
---------
The ``DetectorInfo`` object is accessed by an index going from 0 to N-1, where N is the number of detectors.
A detector index is a way of addressing and enumerating detectors in the beamline.
A detector index can be found from a detector ID using ``indexOf``.
-------
Usage
-------
**Example 1 - Creating a DetectorInfo Object:**
This example shows how to obtain a DetectorInfo object from a workspace object.
This example shows how to obtain a ``DetectorInfo`` object from a workspace object.
The return value is a ``DetectorInfo`` object.
.. testcode:: CreateDetectorInfoObject
......@@ -33,9 +40,17 @@ The return value is a ``DetectorInfo`` object.
info = ws.detectorInfo()
print(type(info))
Output:
.. testoutput:: CreateDetectorInfoObject
<class 'mantid.geometry._geometry.DetectorInfo'>
**Example 2 - Calling the setMasked method on the DetectorInfo Object:**
This example shows how to call the ``setMasked`` method.
The method takes in an integer ``index`` parameter which corresponds to a component and a boolean ``masked`` parameter which allows the user to set the masking to True or False.
The method takes in an integer ``index`` parameter which corresponds to a detector and a boolean ``masked`` parameter.
The user then has the option to set the masking of the detector identified by ``index`` to True or False.
.. testcode:: CallSetMaskedMethod
......@@ -51,6 +66,14 @@ The method takes in an integer ``index`` parameter which corresponds to a compon
info.setMasked(0, False)
print(info.isMasked(0))
Output:
.. testoutput:: CallSetMaskedMethod
True
False
**Example 3 - Calling the twoTheta method on the DetectorInfo Object:**
The ``twoTheta()`` method takes in an integer ``index`` parameter which represents a detector index.
The return value is a float which represents the scattering angle with respect to the beam direction.
......@@ -64,7 +87,14 @@ The return value is a float which represents the scattering angle with respect t
info = ws.detectorInfo()
# Call twoTheta
print(type(info.twoTheta(0)))
print(info.twoTheta(0))
Output:
.. testoutput:: CallTwoThetaMethod
0.0
**Example 4 - Calling the position method on the DetectorInfo Object:**
The ``position()`` method takes an ``index`` parameter which represents a detector index.
......@@ -80,7 +110,13 @@ The returned object is of type V3D which is a position in 3D space.
info = ws.detectorInfo()
# Call the position method
print(type(info.position(0)))
print(info.position(0))
Output:
.. testoutput:: CallPositionMethod
[0,0,5]
**Example 5 - Calling the size method on the DetectorInfo Object:**
......@@ -101,23 +137,6 @@ One can also use the built in ``__len__`` function to obtain the same result.
Output:
.. testoutput:: CreateDetectorInfoObject
<class 'mantid.geometry._geometry.DetectorInfo'>
.. testoutput:: CallSetMaskedMethod
True
False
.. testoutput:: CallTwoThetaMethod
<class 'float'>
.. testoutput:: CallPositionMethod
<class 'mantid.kernel._kernel.V3D'>
.. testoutput:: CallSizeAndLenMethods
200
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment