Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
2eb59b2e
Commit
2eb59b2e
authored
10 years ago
by
Gigg, Martyn Anthony
Browse files
Options
Downloads
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp
+2
-2
2 additions, 2 deletions
Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp
Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst
+42
-1
42 additions, 1 deletion
Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst
with
44 additions
and
3 deletions
Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp
+
2
−
2
View file @
2eb59b2e
...
...
@@ -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
(
"
Save
LocationParameters"
,
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
(
"
Save
LocationParameters"
);
const
bool
saveLocationParams
=
getProperty
(
"LocationParameters"
);
const
std
::
string
filename
=
getProperty
(
"Filename"
);
const
Instrument_const_sptr
instrument
=
ws
->
getInstrument
();
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/docs/source/algorithms/SaveParameterFile-v1.rst
+
42
−
1
View file @
2eb59b2e
...
...
@@ -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
Save
LocationParameters 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::
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment