\(\renewcommand\AA{\unicode{x212B}}\)

LoadFullprofResolution v1

Summary

Load Fullprof’s resolution (.irf) file to one or multiple TableWorkspace(s) and/or where this is supported. See description section, translate fullprof resolution fitting parameter into Mantid equivalent fitting parameters.

See Also

LoadFullprofFile

Properties

Name

Direction

Type

Default

Description

Filename

Input

string

Mandatory

Path to an Fullprof .irf file to load. Allowed extensions: [‘.irf’]

OutputTableWorkspace

Output

TableWorkspace

Name of the output TableWorkspace containing profile parameters or bank information.

UseBankIDsInFile

Input

boolean

True

Use bank IDs as given in file rather than ordinal number of bank.If the bank IDs in the file are not unique, it is advised to set this to false.

Banks

Input

int list

ID(s) of specified bank(s) to load, The IDs are as specified by UseBankIDsInFile.Default is all banks contained in input .irf file.

Workspace

InOut

WorkspaceGroup

A workspace group with the instrument to which we add the parameters from the Fullprof .irf file with one workspace for each bank of the .irf file

WorkspacesForBanks

Input

int list

For each Fullprof bank, the ID of the corresponding workspace in same order as the Fullprof banks are specified. ID=1 refers to the first workspace in the workspace group, ID=2 refers to the second workspace and so on. Default is all workspaces in numerical order.If default banks are specified, they too are taken to be in numerical order

Description

Load Fullprof resolution (.irf) file to TableWorkspace(s) and optionally into the instruments of matrix workspaces with one workspace per bank of the .irf file. Either or both of the Tableworkspace(s) and matrix workspace must be set.

Where a Workspace is specified the support for translating Fullprof resolution parameters into the workspace for subsequent fitting is limitted to Fullprof:

Note for NPROF=9 the translation is currently ignoring the Lorentzian part of the pseudo-Voigt.

Usage

Example - Run LoadprofResolution for both TableWorkspace and workspace with MUSR Instrument

Note

To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.

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 of output table workspace
print("First 4 rows of OutputTableWorkspace")
for i in [0,1,2,3]:
   row = tws.row(i)
   print("{{'Name': '{}', 'Value_3': {:.2f}, 'Value_5': {:.2f}}}".format(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 = {}".format(inst.getParameterType('Alpha0')))
print("Beta0 type = {}".format(inst.getParameterType('Beta0')))
print("SigmaSquared type = {}".format(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:

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: AlgorithmIndex | Diffraction\DataHandling

Source

C++ header: LoadFullprofResolution.h

C++ source: LoadFullprofResolution.cpp