-
Bhuvan Bezawada authored
re #22885 re #23093
Bhuvan Bezawada authoredre #22885 re #23093
DetectorInfo
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.
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.
DetectorInfo is one of three objects that the user can gain access to from a Workspace. The other two are: * SpectrumInfo * ComponentInfo
Usage
Example 1 - Creating a DetectorInfo Object:
This example shows how to obtain a DetectorInfo object from a workspace object.
The return value is a DetectorInfo
object.
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.
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.
Example 4 - Calling the position method on the DetectorInfo Object:
The position()
method takes an index
parameter which represents a detector index and returns the absolute position of that detector. The returned object is of type V3D which is a essentially 3D vector.
Example 5 - Calling the size method on the DetectorInfo Object:
The size()
method does not take in any parameters and returns a number of detectors in the instrument. One can also use the built in __len__
function to obtain the same result.
Output:
<class 'mantid.geometry._geometry.DetectorInfo'>
True False
<type 'float'>
<class 'mantid.kernel._kernel.V3D'>
200 200
bases: :py:obj:`mantid.geometry.DetectorInfo`