Skip to content
Snippets Groups Projects
Commit f3b9bdb6 authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #24322. Documentation update.

parent cc763bc3
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,28 @@ ComponentInfo
Introduction
------------
``ComponentInfo`` provides faster and simpler access to instrument/beamline geometry as required by Mantid :ref:`Algorithms <Algorithm>` than was possible using :ref:`Instrument`. ``ComponentInfo`` and :ref:`DetectorInfo` are designed as full replacements to :ref:`Instrument`. At the time of writing, `ComponentInfo` is incomplete.
``ComponentInfo`` provides faster and simpler access to instrument/beamline geometry as required by Mantid :ref:`Algorithms <Algorithm>` than was possible using :ref:`Instrument`. ``ComponentInfo`` and :ref:`DetectorInfo` are designed as full replacements to :ref:`Instrument`.
Until complete, :ref:`Instrument Access Layers <InstrumentAccessLayers>` provides the best details on how `ComponentInfo` can be used in it's current state of implementation.
:ref:`Instrument Access Layers <InstrumentAccessLayers>` provides details on how `DetectorInfo` interacts with other geometry access layers.
Python Interface
----------------
Examples of using ``ComponentInfo`` in python
Print indices of detectors in "bank1" that are masked
.. code-block:: python
from mantid.simpleapi import CreateSampleWorkspace
from mantid.geometry import ComponentInfo, ComponentInfoPythonIterator
from mantid.geometry import DetectorInfo, DetectorInfoPythonIterator
ws = CreateSampleWorkspace()
comp_info = ws.componentInfo()
det_info = ws.detectorInfo()
bank_index compinfo.indexOfAny('bank1')
for det_index in compinfo.detectorsInSubtree(bank_index):
if det_info.isMasked(int(det_index)):
print('Masked detector of bank1, ', det_index)
......@@ -9,6 +9,39 @@ DetectorInfo
Introduction
------------
``DetectorInfo`` provides faster and simpler access to instrument/beamline detector geometry and metadata as required by Mantid :ref:`Algorithms <Algorithm>` than was possible using :ref:`Instrument`. ``DetectorInfo`` and :ref:`ComponentInfo` are designed as full replacements to :ref:`Instrument`. At the time of writing, `DetectorInfo` is incomplete.
``DetectorInfo`` provides faster and simpler access to instrument/beamline detector geometry and metadata as required by Mantid :ref:`Algorithms <Algorithm>` than was possible using :ref:`Instrument`. ``DetectorInfo`` and :ref:`ComponentInfo` are designed as full replacements to :ref:`Instrument`.
Until complete, :ref:`Instrument Access Layers <InstrumentAccessLayers>` provides the best details on how `DetectorInfo` can be used in it's current state of implementation.
:ref:`Instrument Access Layers <InstrumentAccessLayers>` provides details on how `DetectorInfo` interacts with other geometry access layers.
Python Interface
----------------
Examples of using ``DetectorInfo`` in python
Mask detectors at some distance from the source
.. code-block:: python
from mantid.simpleapi import CreateSampleWorkspace
from mantid.geometry import DetectorInfo, DetectorInfoPythonIterator
# Test workspace with instrument
ws = CreateSampleWorkspace()
det_info = ws.detectorInfo();
for item in det_info:
if not item.isMonitor and item.l2 > 2.0:
item.setMasked(True)
Print detectors with scattering angle
.. code-block:: python
from mantid.simpleapi import CreateSampleWorkspace
from mantid.geometry import DetectorInfo, DetectorInfoPythonIterator
# Test workspace with instrument
ws = CreateSampleWorkspace()
det_info = ws.detectorInfo()
for item in det_info:
if item.l2 > 0.01:
print(item.index)
......@@ -37,12 +37,20 @@ There is also a near-complete implementation of the "real" ``DetectorInfo`` clas
``ExperimentInfo`` now also provides a method ``mutableDetectorInfo()`` so that non-const access to the DetectorInfo is possible for purposes of writing detector related information such as positions or rotations.
The python interface to ``DetectorInfo`` has matured, and includes widespread immutable access via iterators. The iterators can also be used to set masking flags.
See :ref:`DetectorInfo <DetectorInfo>` for more information.
ComponentInfo
______________
``ComponentInfo`` can be obtatined from a call to ``ExperimentInfo::componentInfo()`` (usually this method would be called on ``MatrixWorkspace``). Much like ``DetectorInfo``, the ``ComponentInfo`` yielded from this method call is a wrapper, which contains shape and index information, that cannot yet be moved in to the real ``Beamline::ComponentInfo``. However, replacing existing usage of ``IComponent`` and ``IObjComponent`` wherever possible with ``ComponentInfo`` across the framework will represent a major step forwards.
For writing to the component tree. You can extract a non-const ``ComponentInfo`` via ``ExperimentInfo::mutableComponentInfo``.
The python interface to ``ComponentInfo`` has matured, and now provides equal, if not better support than the ``Instrument`` API for navigating the high-level instrument. Iterator support has also been provided for ``ComponentInfo``.
See :ref:`ComponentInfo <ComponentInfo>` for more information.
Changes for Rollout
-------------------
......
......@@ -124,8 +124,8 @@ New
* :class:`mantid.geometry.DetectorInfo`
* :class:`mantid.api.SpectrumInfo`
- :class:`mantid.geometry.ComponentInfo` is exposed to allow the user to access geometric information about the components which are part of a beamline.
- :class:`mantid.geometry.DetectorInfo` offers the user the ability to access geometric information about the detector(s) which are part of a beamline. ``DetectorInfo`` has also been given an iterator to allow users to write more Pythonic loops rather than normal index based loops.
- :class:`mantid.geometry.ComponentInfo` is exposed to allow the user to access geometric information about the components which are part of a beamline. Iterator support is also provided via python.
- :class:`mantid.geometry.DetectorInfo` offers the user the ability to access geometric information about the detector(s) which are part of a beamline. ``DetectorInfo`` has also been given a python iterator.
- :class:`mantid.api.SpectrumInfo` allows the user to access information about the spectra being used in a beamline. ``SpectrumInfo`` has also been given an iterator to allow users to write more Pythonic loops rather than normal index based loops. In addition to this ``SpectrumDefinition`` objects can also be accessed via a :class:`mantid.api.SpectrumInfo` object. The ``SpectrumDefinition`` object can be used to obtain information about the spectrum to detector mapping and provides a definition of what a spectrum comprises, i.e. indices of all detectors that contribute to the data stored in the spectrum.
- Added new :ref:`unit <Unit Factory>` called ``Temperature`` which has units of Kelvin.
- Importing ``mantid`` no longer initializes the ``FrameworkManager``. This allows separate classes to be imported without requiring a long delay in waiting for the framework to start. Amongst other things this allows the application name to be set correctly:
......
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