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

MagneticFormFactorCorrectionMD v1

Summary

Apply magnetic form factor correction to MD events by dividing signal with F(Q)^2

See Also

MagFormFactorCorrection

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MDEventWorkspace

Mandatory

An input MDEventWorkspace. Must be in Q.

OutputWorkspace

Output

MDEventWorkspace

Mandatory

The output MDEventWorkspace with correction applied.

IonName

Input

string

Cu2

The name of the ion: an element symbol with a number indicating the valence, e.g. Fe2 for Fe2+ / Fe(II). Allowed values: [‘Au5’, ‘Au2’, ‘Au1’, ‘Pt6’, ‘Pt4’, ‘Pt3’, ‘Pt2’, ‘Ir6’, ‘Au4’, ‘Ir4’, ‘Pd1’, ‘Pd0’, ‘Pr3’, ‘Np4’, ‘Mo0’, ‘Rh0’, ‘Ir5’, ‘Zr1’, ‘Y0’, ‘Eu2’, ‘Tm2’, ‘Zr0’, ‘Ce2’, ‘Fe1’, ‘Gd2’, ‘U5’, ‘Re0’, ‘Cu3’, ‘Am4’, ‘Mo1’, ‘Mn2’, ‘Cu2’, ‘Cr3’, ‘Cu0’, ‘Ni4’, ‘Ni1’, ‘Tc0’, ‘U3’, ‘Ni0’, ‘Rh1’, ‘Nb1’, ‘Re6’, ‘Fe3’, ‘Tc1’, ‘Ti3’, ‘Cr4’, ‘Yb2’, ‘Fe0’, ‘Yb3’, ‘Cu1’, ‘Ni3’, ‘Ir1’, ‘Ni2’, ‘W0’, ‘W1’, ‘Ti0’, ‘Co3’, ‘Am7’, ‘Co1’, ‘V4’, ‘Pu3’, ‘Ti2’, ‘Mn3’, ‘Mn0’, ‘Co2’, ‘Cu4’, ‘Er2’, ‘V2’, ‘Ta3’, ‘Ce3’, ‘Sc1’, ‘Cr1’, ‘V1’, ‘Ta4’, ‘Mn4’, ‘W5’, ‘Ir2’, ‘Np6’, ‘Cr2’, ‘Ru0’, ‘Np5’, ‘W3’, ‘V0’, ‘Au3’, ‘Fe2’, ‘V3’, ‘Tm3’, ‘Mn1’, ‘Ti1’, ‘Nd3’, ‘Fe4’, ‘Nd2’, ‘Sm2’, ‘Sm3’, ‘Eu3’, ‘Os3’, ‘Gd3’, ‘Tb3’, ‘Tb2’, ‘Dy2’, ‘Hf3’, ‘Am5’, ‘Os6’, ‘Pt1’, ‘Dy3’, ‘Ho2’, ‘Os2’, ‘Ho3’, ‘Pu5’, ‘Re3’, ‘Er3’, ‘U4’, ‘Ir0’, ‘Np3’, ‘Cr0’, ‘Os7’, ‘Pu4’, ‘Pu6’, ‘Co4’, ‘Ir3’, ‘Am2’, ‘Re2’, ‘Am3’, ‘Sc2’, ‘Os1’, ‘Am6’, ‘Hf2’, ‘Ta2’, ‘Co0’, ‘Re4’, ‘Pt5’, ‘W2’, ‘Ru1’, ‘Re5’, ‘Nb0’, ‘Sc0’, ‘W4’, ‘Re1’, ‘Os0’, ‘Os4’, ‘Os5’]

Description

Scales the the signal and error of MD events by \(1/|F(Q)|^2\) where \(F(Q)\) is the magnetic form factor for the ion specified in IonName.

IonName must be specified as a string with the element name followed by a number which indicates the charge / oxidation state. E.g. Fe2 indicates \(\mathrm{Fe}^{2+}\) or Fe(II).

Input workspace must be in Q with either 1 dimension of |Q| or 3 Q_sample/Q_lab dimensions. It is assumed that the Q dimensions come first follow by any number of other dimensions.

Usage

Example - MagneticFormFactorCorrectionMD

# Create a test MD workspace
ws = CreateMDWorkspace(Dimensions='1', Extents='1,4',
                       Names='|Q|', Units='A')
FakeMDEventData(ws, UniformParams=-6000)

# Run the algorithm
wsOut = MagneticFormFactorCorrectionMD(ws, IonName="U5")

# Bin the result so that it can be printed
wsOut = BinMD(wsOut, AlignedDim0='|Q|,1,4,6')
ws = BinMD(ws, AlignedDim0='|Q|,1,4,6')

# Print the result
print("Input signal:    ", [int(x) for x in ws.getSignalArray()])
print("Corrected signal:", [int(x) for x in wsOut.getSignalArray()])

Output:

Input signal:     [1000, 1000, 1000, 1000, 1000, 1000]
Corrected signal: [1137, 1281, 1498, 1813, 2270, 2937]

Categories: AlgorithmIndex | MDAlgorithms

Source

C++ header: MagneticFormFactorCorrectionMD.h

C++ source: MagneticFormFactorCorrectionMD.cpp