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

MagFormFactorCorrection v1

../_images/MagFormFactorCorrection-v1_dlg.png

MagFormFactorCorrection dialog.

Summary

MagFormFactorCorrection corrects a workspace for the magnetic form factor F(Q) by dividing S(Q,w) by F(Q)^2.

See Also

SofQW

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Workspace must have one axis with units of Q

OutputWorkspace

Output

MatrixWorkspace

Mandatory

Output workspace name.

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’]

FormFactorWorkspace

Output

MatrixWorkspace

If specified the algorithm will create a 1D workspace with the form factor vs Q with a name given by this field.

Description

Scales the InputWorkspace 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).

Restrictions on the Input Workspace

The input workspace must have one axis with units of MomentumTransfer.

Usage

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.

ISIS Example

The following code will run a reduction on a MARI (ISIS) dataset and apply the algorithm to the reduced data. The datafiles (runs 21334, 21337, 21346) and map file ‘mari_res2013.map’ should be in your path. Run number 21337 is a measurement of a PrAl3 sample from the neutron training course. The single crystal field excitation around 4.5 meV should have an intensity variation that follows the magnetic form factor. Thus, the integrating between 4 and 5 meV in the corrected workspace should yield a nearly flat line along the \(|Q|\) direction.

from Direct import DirectEnergyConversion
from mantid.simpleapi import *
rd = DirectEnergyConversion.DirectEnergyConversion('MARI')
ws = rd.convert_to_energy(21334, 21337, 15, [-15,0.05,15], 'mari_res2013.map',
    monovan_run=21346, sample_mass=10.62, sample_rmm=221.856, monovan_mapfile='mari_res2013.map')
ws_sqw = SofQW3(ws, [0,0.05,6], 'Direct', 15)
ws_corr = MagFormFactorCorrection(ws_sqw, IonName='Pr3', FormFactorWorkspace='Pr3FF')

Test Example

This example uses a generated dataset so that it will run on automated tests of the build system where the above datafiles do not exist.

import numpy as np
ws = CreateSampleWorkspace(binWidth = 0.1, XMin = 0, XMax = 50, XUnit = 'DeltaE')
ws = ScaleX(ws, -15, "Add")
LoadInstrument(ws, InstrumentName='MARI', RewriteSpectraMap = True)
ws = SofQW(ws, [0, 0.05, 8], 'Direct', 35)
Q = ws.getAxis(1).extractValues()
for i in range(len(Q)-1):
    qv = ( (Q[i]+Q[i+1])*0.5 ) / 4 / np.pi
    y = ws.dataY(i)
    y *= np.exp(-16*qv*qv)
ws_corr = MagFormFactorCorrection(ws, IonName='Fe3', FormFactorWorkspace='Fe3FF')

Categories: AlgorithmIndex | CorrectionFunctions