ResNorm v1

../_images/ResNorm-v1_dlg.png

ResNorm dialog.

Summary

This algorithm creates a group ‘normalisation’ file by taking a resolution file and fitting it to all the groups in the resolution (vanadium) data file which has the same grouping as the sample data of interest.

Properties

Name Direction Type Default Description
InputType Input string File Origin of data input - File (.nxs) or Workspace. Allowed values: [‘File’, ‘Workspace’]
Instrument Input string iris Instrument. Allowed values: [‘irs’, ‘iris’, ‘osi’, ‘osiris’]
Analyser Input string graphite002 Analyser & reflection. Allowed values: [‘graphite002’, ‘graphite004’]
VanNumber Input string Mandatory Sample run number
ResInputType Input string File Origin of res input - File (_res.nxs) or Workspace. Allowed values: [‘File’, ‘Workspace’]
ResNumber Input string Mandatory Resolution run number
EnergyMin Input number -0.2 Minimum energy for fit. Default=-0.2
EnergyMax Input number 0.2 Maximum energy for fit. Default=0.2
VanBinning Input number 1 Binning value (integer) for sample. Default=1
Plot Input string None Plot options. Allowed values: [‘None’, ‘Intensity’, ‘Stretch’, ‘Fit’, ‘All’]
Save Input boolean False Switch Save result to nxs file Off/On

Description

The routine varies the width of the resolution file to give a ‘stretch factor’ and the area provides an intensity normalisation factor. The fitted parameters are in the group workspace with suffix _ResNorm with additional suffices of Intensity & Stretch. The fitted data are in the workspace ending in _ResNorm_Fit.

This routine was originally part of the MODES package.

Usage

Example - a basic example using ResNorm.

def createSampleWorkspace(name, random=False):
""" Creates a sample workspace with a single lorentzian that looks like IRIS data"""
import os
function = "name=Lorentzian,Amplitude=8,PeakCentre=5,FWHM=0.7"
ws = CreateSampleWorkspace("Histogram", Function="User Defined", UserDefinedFunction=function, XUnit="DeltaE", Random=True, XMin=0, XMax=10, BinWidth=0.01)
ws = CropWorkspace(ws, StartWorkspaceIndex=0, EndWorkspaceIndex=9)
ws = ScaleX(ws, -5, "Add")
ws = ScaleX(ws, 0.1, "Multiply")

#load instrument and instrument parameters
LoadInstrument(ws, InstrumentName='IRIS', RewriteSpectraMap=True)
path = os.path.join(config['instrumentDefinition.directory'], 'IRIS_graphite_002_Parameters.xml')
LoadParameterFile(ws, Filename=path)
ws = RenameWorkspace(ws, OutputWorkspace=name)
return ws

ws = createSampleWorkspace(“irs26173_graphite002_red”, random=True) res = createSampleWorkspace(“irs26173_graphite002_res”)

ResNorm(VanNumber=‘26176’,
ResNumber=‘26173’, InputType=’Workspace’, ResInputType=’Workspace’, Instrument=’irs’, Analyser=’graphite002’, Plot=’None’, Version=1)

Categories: Algorithms | Workflow\MIDAS

Source

Python: ResNorm.py (last modified: 2016-10-12)