Skip to content

Commit

Permalink
Usage Example for GeneralisedSecondDifference re #10052
Browse files Browse the repository at this point in the history
Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Sep 19, 2014
1 parent b8b92dc commit 1e32352
Showing 1 changed file with 24 additions and 0 deletions.
Expand Up @@ -16,4 +16,28 @@ Instruments and Methods 50, 309 (1967). Given a spectrum with value yi
difference curve, smoothed by averaging each point in the interval
[-m,+m], and applying this procedure z times.

Usage
-----

**Example - Use on a single peak**

.. testcode:: ExGeneralisedSecondDifferenceSimple

# Create Workspace with peak around x=15.0
ws = CreateSampleWorkspace(BankPixelWidth=1, Xmax=30, BinWidth=1)

# Apply algorithm.
wsD = GeneralisedSecondDifference(ws,M=2,Z=2)

# Show values around the peak
print "%.2f, %.2f, %.2f, %.2f, %.2f" % (wsD.readY(0)[8], wsD.readY(0)[9], wsD.readY(0)[10], wsD.readY(0)[11], wsD.readY(0)[12])
print "Peak at", wsD.readX(0)[10]

Output:

.. testoutput:: ExGeneralisedSecondDifferenceSimple

-0.34, -7.21, -20.00, -7.21, -0.34
Peak at 15.0

.. categories::

0 comments on commit 1e32352

Please sign in to comment.