Skip to content

Commit

Permalink
Add SaveParametersFile python usage example.
Browse files Browse the repository at this point in the history
Refs #10023
  • Loading branch information
Harry Jeffery committed Jul 30, 2014
1 parent f7a4213 commit e905a7f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst
Expand Up @@ -17,3 +17,40 @@ Mantid using the `LoadParameterFile <http://mantidproject.org/LoadParameterFile>
The LocationParameters property specifies whether or not to save any calibration parameters
used to adjust the location of any components. Specifically, it will skip "x", "y", "z",
"r-position", "t-position", "p-position", "rotx", "roty", and "rotz" parameters.

Usage
-----

**Example - save an instrument's parameters to a file:**

.. testcode:: ExParametersSimple

Load(Filename="MAR11001.raw", OutputWorkspace="MAR11001", LoadMonitors="Separate")
SaveParameterFile(Workspace="MAR11001", Filename="/tmp/params.xml", LocationParameters=False)

pfile = open("/tmp/params.xml", "r")
lines = pfile.readlines()
pfile.close()

for line in lines[0:6]:
print(line.strip())
print("etc...")

.. testcleanup:: ExParametersSimple

import os
os.remove("/tmp/params.xml")

Output:

.. testoutput:: ExParametersSimple

<?xml version="1.0" encoding="UTF-8"?>
<parameter-file instrument="MARI" valid-from="1900-01-31T23:59:59">
<component-link name="MARI">
<parameter name="DelayTime">
<value val="-3.9"/>
</parameter>
etc...

.. categories::

0 comments on commit e905a7f

Please sign in to comment.