Skip to content
Snippets Groups Projects
Commit 0fcffd00 authored by Nick Draper's avatar Nick Draper
Browse files

re #10041 Added links for property type and a couple of concept pages

parent e2584d46
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
Description
-----------
Adds a `IPeak <http://www.mantidproject./IPeak>`__ to a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__.
Adds a peak to a :ref:`PeaksWorkspace <PeaksWorkspace>`.
Usage
-----
......
......@@ -11,7 +11,7 @@ Description
This algorithm can be used to combine lists of single crystal peaks,
possibly obtained by different methods, in to a single list (contained
in a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__).
in a :ref:`PeaksWorkspace <PeaksWorkspace>`).
With the default options, this will simply append the lists of peaks.
If CombineMatchingPeaks is selected then an attempt
will be made to identify identical peaks by matching them in Q within
......
......@@ -9,7 +9,7 @@
Description
-----------
Filters a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__ using a set number of
queries. Outputs a filtered `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__.
Filters a :ref:`PeaksWorkspace <PeaksWorkspace>` using a set number of
queries. Outputs a filtered :ref:`PeaksWorkspace <PeaksWorkspace>`.
.. categories::
......@@ -20,7 +20,7 @@ correct integration radius for each peak.
The algorithm requires a :ref:`MDWorkspace <MDWorkspace>` of SCD data in
reciprocal space; generated by e.g.
:ref:`algm-ConvertToDiffractionMDWorkspace`.
Also, you will need a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__ as the list of
Also, you will need a :ref:`PeaksWorkspace <PeaksWorkspace>` as the list of
peaks to integrate. This can be generated using
:ref:`algm-FindPeaksMD`, for example.
......
.. _PeaksWorkspace:
PeaksWorkspace
==============
The PeaksWorkspace is a special Workspace that holds a list of single crystal Peak objects.
Creating a PeaksWorkspace
-------------------------
* :ref:`FindPeaksMD <algm-FindPeaksMD>` will find peaks in reciprocal space in a [[MDWorkspace]]
* :ref:`FindSXPeaks <algm-FindSXPeaks>` will find peaks in detector space.
* :ref:`PredictPeaks <algm-PredictPeaks>` will predict peak positions in a workspace given a UB matrix.
* The :ref:`LoadIsawPeaks <algm-LoadIsawPeaks>` algorithm will load a PeaksWorkspace from file.
* The :ref:`SaveIsawPeaks <algm-SaveIsawPeaks>` algorithm will save a PeaksWorkspace to a file.
* :ref:`CreatePeaksWorkspace <algm-CreatePeaksWorkspace>` will create an empty PeaksWorkspace that you can then edit.
Viewing a PeaksWorkspace
------------------------
* Double-click a PeaksWorkspace to see the full list of data of each Peak object.
* In MantidPlot, you can drag/drop a PeaksWorkspace from the list of workspaces onto the `Instrument View <http://www.mantidproject.org/MantidPlot:_Instrument_View>`__ . This will overlay the peaks onto the detector face.
* Right-click a PeaksWorkspace and select the menu to show the peak positions in 3D in the `VatesSimpleInterface <http://www.mantidproject.org/VatesSimpleInterface>`__ .
* In paraview, you can load a .Peaks file loader plugin to view a PeaksWorkspace.
The Peak Object
---------------
Each peak object contains several pieces of information. Not all of them are necessary:
* Detector position and wavelength
* Q position (calculated from the detector position/wavelength)
* H K L indices (optional)
* Goniometer rotation matrix (for finding Q in the sample frame)
* Integrated intensity and error (optional)
* Row/column of detector (only for :ref:`RectangularDetectors <RectangularDetector>` )
Using PeaksWorkspace's in Python
--------------------------------
The PeaksWorkspace and Peak objects are exposed to python.
PeaksWorkspace Python Interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
pws = mtd['name_of_peaks_workspace']
pws.getNumberOfPeaks()
p = pws.getPeak(12)
pws.removePeak(34)
Peak Python Interface
~~~~~~~~~~~~~~~~~~~~~
You can get a handle to an existing peak with:
.. code-block:: python
p = pws.getPeak(12)
Or you can create a new peak in this way:
.. code-block:: python
qlab = V3D(1.23, 3.45, 2.22) # Q in the lab frame of the peak
detector_distance = 2.5 # sample-detector distance in meters
p = pws.createPeak(qlab, detector_distance)
# The peak can later be added to the workspace
pws.addPeak(p)
Once you have a handle on a peak ''p'' you have several methods to query/modify its values:
.. code-block:: python
hkl = p.getHKL()
p.setHKL(-5, 4, 3)
q = p.getQSampleFrame()
q = p.getQLabFrame()
detid = p.getDetectorID()
p.setIntensity(1000.0)
p.setSigmaIntensity(31.6)
counts = p.getIntensity()
wl = p.getWavelength()
tof = p.getTOF()
d = p.getDSpacing()
.. categories:: Concepts
\ No newline at end of file
.. _RectangularDetector:
RectangularDetector
===================
The rectangular detector is a detector bank that is marked as being a regular rectangular bank. It is a particular class in Mantid (RectangularDetector).
In order to be a RectangularDetector, a bank has to have these characteristics:
- All pixels are the same size and shape (can be any size/shape)
- The pixels are regularly spaced (the X/Y spacing can be different)
- The pixels form a rectangular array (there can be gaps between pixels).
Several instruments including TOPAZ, PG3 and SNAP instruments use RectangularDetectors.
See the :ref:`InstrumentDefinitionFile <InstrumentDefinitionFile>` page for instructions on defining a rectangular detector.
.. categories:: Concepts
\ No newline at end of file
......@@ -55,12 +55,24 @@ class PropertiesDirective(AlgorithmBaseDirective):
# int.
direction_string = ["Input", "Output", "InOut", "None"]
#dictionary to convert from property type to link to category page (where possible)
property_type_dict = {
"Workspace":":ref:`Workspace <Workspace>`",
"Workspace2D":":ref:`Workspace2D <Workspace2D>`",
"EventWorkspace":":ref:`EventWorkspace <EventWorkspace>`",
"MatrixWorkspace":":ref:`MatrixWorkspace <MatrixWorkspace>`",
"GroupWorkspace":":ref:`GroupWorkspace <WorkspaceGroup>`",
"MDEventWorkspace":":ref:`MDEventWorkspace <MDWorkspace>`",
"MDHistoWorkspace":":ref:`MDHistoWorkspace <MDHistoWorkspace>`",
"TableWorkspace":":ref:`TableWorkspace <Table Workspaces>`"
}
for prop in alg_properties:
# Append a tuple of properties to the list.
properties.append((
str(prop.name),
str(direction_string[prop.direction]),
str(prop.type),
property_type_dict.get(str(prop.type),str(prop.type)),
str(self._get_default_prop(prop)),
str(prop.documentation.replace("\n", " "))
))
......
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