Skip to content

Commit

Permalink
Refs #9584 Add usage example for SaveHKL
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Jun 9, 2014
1 parent 9d72d53 commit 76db215
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Code/Mantid/docs/source/algorithms/SaveHKL-v1.rst
Expand Up @@ -41,4 +41,39 @@ DSP = d-Spacing of peak (Angstroms)/TR

Last line must have all 0's

Usage
-----
**Example - a simple example of running SaveHKL.**

.. testcode:: ExSaveHKLSimple

import os

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

path = os.path.join(config['defaultsave.directory'], "MyPeaks.hkl")
print os.path.isfile(path)

Output:

.. testoutput:: ExSaveHKLSimple

True

.. testcleanup:: ExSaveHKLSimple

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 76db215

Please sign in to comment.