Skip to content
Snippets Groups Projects
Commit 2eb59b2e authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Merge remote-tracking branch 'origin/feature/10023_tweak_saveparameterfile_algorithm'

parents 5ae0361f 109696af
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ namespace DataHandling
declareProperty(new API::FileProperty("Filename","", API::FileProperty::Save, exts),
"The name of the file into which the instrument parameters will be saved.");
declareProperty("SaveLocationParameters", false, "Save the location parameters used to calibrate the instrument.", Direction::Input);
declareProperty("LocationParameters", false, "Save the location parameters used to calibrate the instrument.", Direction::Input);
}
//----------------------------------------------------------------------------------------------
......@@ -77,7 +77,7 @@ namespace DataHandling
void SaveParameterFile::exec()
{
const MatrixWorkspace_const_sptr ws = getProperty("Workspace");
const bool saveLocationParams = getProperty("SaveLocationParameters");
const bool saveLocationParams = getProperty("LocationParameters");
const std::string filename = getProperty("Filename");
const Instrument_const_sptr instrument = ws->getInstrument();
......
......@@ -14,6 +14,47 @@ This algorithm allows instrument parameters to be saved into an
The parameter file can then be inspected and or modified. It can also be loaded back into
Mantid using the `LoadParameterFile <http://mantidproject.org/LoadParameterFile>`__ algorithm.
The SaveLocationParameters property specifies whether or not to save any calibration parameters
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
-----
.. testcode::
import os
#Create a path in the user's home directory
filename = os.path.expanduser("~/params.xml")
#Load a workspace
ws = Load(Filename = "MAR11001.raw")
#Save the workspace's instrument's parameters to the given file.
SaveParameterFile(Workspace = ws, Filename = filename, LocationParameters = False)
#Make sure the file was written successfully
if os.path.isfile(filename):
print "Parameters written successfully."
.. testcleanup::
os.remove(filename)
.. testoutput::
Parameters written successfully.
Example Output::
<?xml version="1.0" encoding="UTF-8"?>
<parameter-file instrument="InstrumentName" valid-from="1900-01-31T23:59:59">
<component-link name="ComponentName">
<parameter name="ParameterName">
<value val="2.17"/>
</parameter>
</component-link>
</parameter-file>
.. categories::
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment