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

MagFormFactorCorrection v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

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

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