Skip to content

Commit

Permalink
Refs #9584 Update SaveHKL with working example.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Jun 9, 2014
1 parent 85c91d7 commit b86d06b
Show file tree
Hide file tree
Showing 2 changed files with 512 additions and 1 deletion.
39 changes: 38 additions & 1 deletion Code/Mantid/docs/source/algorithms/SaveHKL-v1.rst
Expand Up @@ -50,7 +50,7 @@ Usage
import os

#load a peaks workspace from file
peaks = LoadIsawPeaks(Filename=r'TOPAZ_1204.peaks')
peaks = LoadIsawPeaks(Filename=r'Peaks5637.integrate')
SaveHKL(peaks, "MyPeaks.hkl")

path = os.path.join(config['defaultsave.directory'], "MyPeaks.hkl")
Expand All @@ -75,5 +75,42 @@ Output:

removeFiles(["MyPeaks.hkl"])

**Example - an example of running SaveHKL with sorting and filtering options.**

.. testcode:: ExSaveHKLOptions

import os

#load a peaks workspace from file
peaks = LoadIsawPeaks(Filename=r'Peaks5637.integrate')
print "Number of peaks in table %d" % peaks.rowCount()

SaveHKL(peaks, "MyPeaks.hkl", MinWavelength=0.5, MaxWavelength=2,MinDSpacing=0.2, SortBy='Bank')

path = os.path.join(config['defaultsave.directory'], "MyPeaks.hkl")
peaks = LoadHKL(path)
print "Number of peaks in table %d" % peaks.rowCount()

Output:

.. testoutput:: ExSaveHKLOptions

Number of peaks in table 434
Number of peaks in table 234

.. testcleanup:: ExSaveHKLOptions

import os
def removeFiles(files):
for ws in files:
try:
path = os.path.join(config['defaultsave.directory'], ws)
os.remove(path)
except:
pass

removeFiles(["MyPeaks.hkl"])



.. categories::

0 comments on commit b86d06b

Please sign in to comment.