Skip to content

Commit

Permalink
Add AddPeak usage example. Refs #9585.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Jun 6, 2014
1 parent 4a07f58 commit 3e8b85b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
Expand Up @@ -42,16 +42,14 @@ namespace Algorithms

/// Algorithm's name for identification
virtual const std::string name() const { return "AddPeak";};
///Summary of algorithms purpose
virtual const std::string summary() const {return "Adds a peak to a PeaksWorkspace.";}

/// Summary of algorithms purpose
virtual const std::string summary() const { return "Adds a peak to a PeaksWorkspace.";}
/// Algorithm's version for identification
virtual int version() const { return 1;};
/// Algorithm's category for identification
virtual const std::string category() const { return "Crystal;Utility\\Workspaces";}

private:

/// Initialise the properties
void init();
/// Run the algorithm
Expand Down
Expand Up @@ -49,9 +49,8 @@ class DLLExport OptimizeExtinctionParameters: public API::Algorithm
virtual ~OptimizeExtinctionParameters();
/// Algorithm's name for identification overriding a virtual method
virtual const std::string name() const { return "OptimizeExtinctionParameters"; }
///Summary of algorithms purpose
virtual const std::string summary() const {return "Finds optimal mosaic and r_crystallite parameters for extinction correction.";}

///Summary of algorithms purpose
virtual const std::string summary() const { return "Finds optimal mosaic and r_crystallite parameters for extinction correction."; }
/// Algorithm's version for identification overriding a virtual method
virtual int version() const { return 1; }
/// Algorithm's category for identification overriding a virtual method
Expand All @@ -62,8 +61,6 @@ class DLLExport OptimizeExtinctionParameters: public API::Algorithm
private:
/// Point Groups possible
std::vector<Mantid::Geometry::PointGroup_sptr> m_pointGroups;


// Overridden Algorithm methods
void init();
void exec();
Expand Down
26 changes: 25 additions & 1 deletion Code/Mantid/docs/source/algorithms/AddPeak-v1.rst
Expand Up @@ -9,6 +9,30 @@
Description
-----------

Adds a `IPeak <IPeak>`__ to a `PeaksWorkspace <PeaksWorkspace>`__.
Adds a `IPeak <http://www.mantidproject./IPeak>`__ to a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__.

Usage
-----

**Example - Add a peak to a PeaksWorkspace.**

.. testcode:: AddPeak

ws = CreateSampleWorkspace("Histogram","Multiple Peaks")
# Find the peaks in a 2D workspace.
peaks_ws = FindSXPeaks(ws)

print "The number of peaks before adding a peak is: " + str(peaks_ws.getNumberPeaks())
# Add a peak to the peaks workspace.
AddPeak(PeaksWorkspace=peaks_ws,RunWorkspace=ws,DetectorID=101,TOF=3819,Height=10.3,BinCount=2)

print "The number of peaks after adding a peak is: " + str(peaks_ws.getNumberPeaks())

Output:

.. testoutput:: AddPeak

The number of peaks before adding a peak is: 174
The number of peaks after adding a peak is: 175

.. categories::

0 comments on commit 3e8b85b

Please sign in to comment.