diff --git a/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp b/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp index 1f47ac4c05a03bd85456abadac162e9d4fca60bf..0a5dfd20dc8bc7703250a6babec5ccb5abfd74eb 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp @@ -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(); diff --git a/Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst b/Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst index 19fb988bc026ea74527b1fc2fbab60da9d510612..5df213db0e161719e25700581d68086aeaca35e4 100644 --- a/Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst @@ -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::