Skip to content
Snippets Groups Projects
Commit 70d305b4 authored by Anders Markvardsen's avatar Anders Markvardsen
Browse files

Merge remote-tracking branch 'origin/feature/10107_xtend_lfpr_usage_example'

parents a5a0bfd3 cfdc9e02
No related branches found
No related tags found
No related merge requests found
......@@ -37,25 +37,50 @@ Usage
.. testcode:: ExLoadFullprofResolutionSimple
# We run LoadFullprof Resolution with both the OutputTable workspace
# and an appropriate output workspace (group of 2)
# selecting 2 banks from the IRF file
ws = Load("MUSR00015189")
# Run algorithm. MUSR_01.irf has NPROF=13 in 2nd line, so IkedaCarpenterPV will be used.
tws = LoadFullprofResolution("MUSR_01.irf",Banks="3,5", Workspace="ws")
#Print first four rows
#Print first four rows of output table workspace
print "First 4 rows of OutputTableWorkspace"
for i in [0,1,2,3]:
row = tws.row(i)
print "{'Name': '%s', 'Value_3': %.2f, 'Value_5': %.2f}" % ( row["Name"], row["Value_3"], row["Value_5"] )
# Get the instrument with the parameters
inst = ws[0][0].getInstrument()
# demonstrate that the type of parameters saved are fitting parameters
print "Type of 3 parameters got from instrument in workspace"
print "Alpha0 type =", inst.getParameterType('Alpha0')
print "Beta0 type =", inst.getParameterType('Beta0')
print "SigmaSquared type =", inst.getParameterType('SigmaSquared')
# As of the time of writing,
# fitting instrument parameters cannot be
# accessed through the python API.
# They can be accessed via the file in the lext line, if uncommented:
#SaveParameterFile(ws[0][0], "instParam.xml")
#This file should contain the lines shown next and similar for other parameters:
# <parameter name="Alpha0">
# <value val="0 , IkedaCarpenterPV , Alpha0 , , , , Alpha0= , 1.5971070000000001 , , TOF , linear ; TOF ; TOF"/>
# </parameter>
Output:
.. testoutput:: ExLoadFullprofResolutionSimple
First 4 rows of OutputTableWorkspace
{'Name': 'BANK', 'Value_3': 3.00, 'Value_5': 5.00}
{'Name': 'Alph0', 'Value_3': 1.60, 'Value_5': 1.61}
{'Name': 'Alph1', 'Value_3': 1.50, 'Value_5': 1.30}
{'Name': 'Beta0', 'Value_3': 33.57, 'Value_5': 37.57}
Type of 3 parameters got from instrument in workspace
Alpha0 type = fitting
Beta0 type = fitting
SigmaSquared type = fitting
.. 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