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

PaalmanPingsMonteCarloAbsorption v1

../_images/PaalmanPingsMonteCarloAbsorption-v1_dlg.png

PaalmanPingsMonteCarloAbsorption dialog.

Summary

Calculates absorption corrections in Paalman & Pings formalism for a given sample and optionally its environment using a Monte Carlo simulation.

See Also

MonteCarloAbsorption, ApplyPaalmanPingsCorrection, PaalmanPingsAbsorptionCorrection

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

Workspace

Mandatory

Workspace with the measurement of the sample [in a container].

EventsPerPoint

Input

number

1000

Number of neutron events

Interpolation

Input

string

Linear

Type of interpolation. Allowed values: [‘Linear’, ‘CSpline’]

MaxScatterPtAttempts

Input

number

5000

Maximum number of tries made to generate a scattering point

SparseInstrument

Input

boolean

False

Whether to spatially approximate the instrument for faster calculation.

NumberOfDetectorRows

Input

number

3

Number of detector rows in the detector grid of the sparse instrument.

NumberOfDetectorColumns

Input

number

2

Number of detector columns in the detector grid of the sparse instrument.

BeamHeight

Input

number

1

Height of the beam (cm)

BeamWidth

Input

number

1

Width of the beam (cm)

Shape

Input

string

Preset

Geometric shape of the sample environment. Allowed values: [‘Preset’, ‘FlatPlate’, ‘Cylinder’, ‘Annulus’]

Height

Input

number

0

Height of the sample environment (cm)

SampleWidth

Input

number

0

Width of the sample environment (cm)

SampleThickness

Input

number

0

Thickness of the sample environment (cm)

SampleCenter

Input

number

0

Center of the sample environment

SampleAngle

Input

number

0

Angle of the sample environment with respect to the beam (degrees)

SampleRadius

Input

number

0

Radius of the sample environment (cm)

SampleInnerRadius

Input

number

0

Inner radius of the sample environment (cm)

SampleOuterRadius

Input

number

0

Outer radius of the sample environment (cm)

SampleChemicalFormula

Input

string

Chemical formula for the sample material

SampleCoherentXSection

Input

number

0

The coherent cross-section for the sample material in barns. To be used instead of Chemical Formula.

SampleIncoherentXSection

Input

number

0

The incoherent cross-section for the sample material in barns. To be used instead of Chemical Formula.

SampleAttenuationXSection

Input

number

0

The absorption cross-section for the sample material in barns. To be used instead of Chemical Formula.

SampleDensityType

Input

string

Mass Density

Use of Mass density or Number density for the sample. Allowed values: [‘Mass Density’, ‘Number Density’]

SampleNumberDensityUnit

Input

string

Atoms

Choose which units SampleDensity refers to. Allowed values: [Atoms, Formula Units]. Allowed values: [‘Atoms’, ‘Formula Units’]

SampleDensity

Input

number

0

The value for the sample Mass density (g/cm^3) or Number density (1/Angstrom^3).

ContainerFrontThickness

Input

number

0

Front thickness of the container environment (cm)

ContainerBackThickness

Input

number

0

Back thickness of the container environment (cm)

ContainerRadius

Input

number

0

Outer radius of the sample environment (cm)

ContainerInnerRadius

Input

number

0

Inner radius of the container environment (cm)

ContainerOuterRadius

Input

number

0

Outer radius of the container environment (cm)

ContainerChemicalFormula

Input

string

Chemical formula for the container material

ContainerCoherentXSection

Input

number

0

The coherent cross-section for the can material in barns. To be used instead of Chemical Formula.

ContainerIncoherentXSection

Input

number

0

The incoherent cross-section for the can material in barns. To be used instead of Chemical Formula.

ContainerAttenuationXSection

Input

number

0

The absorption cross-section for the can material in barns. To be used instead of Chemical Formula.

ContainerDensityType

Input

string

Mass Density

Use of Mass density or Number density for the container. Allowed values: [‘Mass Density’, ‘Number Density’]

ContainerNumberDensityUnit

Input

string

Atoms

Choose which units ContainerDensity refers to. Allowed values: [Atoms, Formula Units]. Allowed values: [‘Atoms’, ‘Formula Units’]

ContainerDensity

Input

number

0

The value for the container Mass density (g/cm^3) or Number density (1/Angstrom^3).

CorrectionsWorkspace

Output

WorkspaceGroup

corrections

Name of the workspace group to save correction factors

Description

This algorithm calculates the attenuation factors in the Paalman Pings formalism using a Monte Carlo simulation.

Three simple shapes are supported: FlatPlate, Cylinder, and Annulus. Each shape is defined by the corresponding set of geometric parameters.

If the Preset shape option is chosen, the algorithm will use the sample and container shapes defined in the workspace.

Inelastic, quasielastic and elastic measurements are supported, both for direct and indirect geometry instruments.

Height is a common property for the sample and container regardless the shape.

Below are the required properties for each specific shape:

FlatPlate

  • SampleThickness

  • SampleWidth

  • SampleCenter

  • SampleAngle

  • ContainerFrontThickness

  • ContainerBackThickness

Cylinder

  • SampleRadius

  • ContainerRadius stands for the outer radius of the annular container, inner radius of which is the same as the radius of the sample.

Annulus

  • ContainerInnerRadius

  • SampleInnerRadius

  • SampleOuterRadius

  • ContainerOuterRadius

The sample and container shapes and materials are set by SetSample.

The actual calculations are performed using MonteCarloAbsorption for each individual correction term.

The corrections should be applied by the ApplyPaalmanPingsCorrection, where you can find further documentation on the signification of the correction terms and the method.

Note

When container is specified, it is assumed to be tightly wrapping the sample of corresponding shape; that is, there is no gap between the sample and the container.

Note

All the shape arguments are supposed to be in centimeters.

Usage

Example - FlatPlate

sample_ws = CreateSampleWorkspace(Function="Quasielastic",
                                  XUnit="Wavelength",
                                  XMin=-0.5,
                                  XMax=0.5,
                                  BinWidth=0.01)
# Efixed is generally defined as part of the IDF for real data.
# Fake it here
inst_name = sample_ws.getInstrument().getName()
SetInstrumentParameter(sample_ws, ComponentName=inst_name,
    ParameterName='Efixed', ParameterType='Number', Value='4.1')

corrections = PaalmanPingsMonteCarloAbsorption(
        InputWorkspace=sample_ws,
        Shape='FlatPlate',
        BeamHeight=2.0,
        BeamWidth=2.0,
        Height=2.0,
        SampleWidth=2.0,
        SampleThickness=0.1,
        SampleChemicalFormula='H2-O',
        SampleDensity=1.0,
        ContainerFrontThickness=0.02,
        ContainerBackThickness=0.02,
        ContainerChemicalFormula='V',
        ContainerDensity=6.0,
        CorrectionsWorkspace='flat_plate_corr'
    )

ass_ws = corrections[0]
assc_ws = corrections[1]
acsc_ws = corrections[2]
acc_ws = corrections[3]

print("Y-Unit Label of " + str(ass_ws.getName()) + ": " + str(ass_ws.YUnitLabel()))
print("Y-Unit Label of " + str(assc_ws.getName()) + ": " + str(assc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acsc_ws.getName()) + ": " + str(acsc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acc_ws.getName()) + ": " + str(acc_ws.YUnitLabel()))
Y-Unit Label of flat_plate_corr_ass: Attenuation factor
Y-Unit Label of flat_plate_corr_assc: Attenuation factor
Y-Unit Label of flat_plate_corr_acsc: Attenuation factor
Y-Unit Label of flat_plate_corr_acc: Attenuation factor

Example - Cylinder

sample_ws = CreateSampleWorkspace(Function="Quasielastic",
                                  XUnit="Wavelength",
                                  XMin=-0.5,
                                  XMax=0.5,
                                  BinWidth=0.01)
# Efixed is generally defined as part of the IDF for real data.
# Fake it here
inst_name = sample_ws.getInstrument().getName()
SetInstrumentParameter(sample_ws, ComponentName=inst_name,
    ParameterName='Efixed', ParameterType='Number', Value='4.1')

corrections = PaalmanPingsMonteCarloAbsorption(
        InputWorkspace=sample_ws,
        Shape='Cylinder',
        BeamHeight=2.0,
        BeamWidth=2.0,
        Height=2.0,
        SampleRadius=0.2,
        SampleChemicalFormula='H2-O',
        SampleDensity=1.0,
        ContainerRadius=0.22,
        ContainerChemicalFormula='V',
        ContainerDensity=6.0,
        CorrectionsWorkspace='cylinder_corr'
    )

ass_ws = corrections[0]
assc_ws = corrections[1]
acsc_ws = corrections[2]
acc_ws = corrections[3]

print("Y-Unit Label of " + str(ass_ws.getName()) + ": " + str(ass_ws.YUnitLabel()))
print("Y-Unit Label of " + str(assc_ws.getName()) + ": " + str(assc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acsc_ws.getName()) + ": " + str(acsc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acc_ws.getName()) + ": " + str(acc_ws.YUnitLabel()))
Y-Unit Label of cylinder_corr_ass: Attenuation factor
Y-Unit Label of cylinder_corr_assc: Attenuation factor
Y-Unit Label of cylinder_corr_acsc: Attenuation factor
Y-Unit Label of cylinder_corr_acc: Attenuation factor

Example - Annulus

sample_ws = CreateSampleWorkspace(Function="Quasielastic",
                                  XUnit="Wavelength",
                                  XMin=-0.5,
                                  XMax=0.5,
                                  BinWidth=0.01)
# Efixed is generally defined as part of the IDF for real data.
# Fake it here
inst_name = sample_ws.getInstrument().getName()
SetInstrumentParameter(sample_ws, ComponentName=inst_name,
    ParameterName='Efixed', ParameterType='Number', Value='4.1')

corrections = PaalmanPingsMonteCarloAbsorption(
        InputWorkspace=sample_ws,
        Shape='Annulus',
        BeamHeight=2.0,
        BeamWidth=2.0,
        Height=2.0,
        SampleInnerRadius=0.2,
        SampleOuterRadius=0.4,
        SampleChemicalFormula='H2-O',
        SampleDensity=1.0,
        ContainerInnerRadius=0.19,
        ContainerOuterRadius=0.41,
        ContainerChemicalFormula='V',
        ContainerDensity=6.0,
        CorrectionsWorkspace='annulus_corr'
    )

ass_ws = corrections[0]
assc_ws = corrections[1]
acsc_ws = corrections[2]
acc_ws = corrections[3]

print("Y-Unit Label of " + str(ass_ws.getName()) + ": " + str(ass_ws.YUnitLabel()))
print("Y-Unit Label of " + str(assc_ws.getName()) + ": " + str(assc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acsc_ws.getName()) + ": " + str(acsc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acc_ws.getName()) + ": " + str(acc_ws.YUnitLabel()))
Y-Unit Label of annulus_corr_ass: Attenuation factor
Y-Unit Label of annulus_corr_assc: Attenuation factor
Y-Unit Label of annulus_corr_acsc: Attenuation factor
Y-Unit Label of annulus_corr_acc: Attenuation factor

Example - Preset Shape

sample_ws = CreateSampleWorkspace(Function="Quasielastic",
                                  XUnit="Wavelength",
                                  XMin=-0.5,
                                  XMax=0.5,
                                  BinWidth=0.01)
# Efixed is generally defined as part of the IDF for real data.
# Fake it here
inst_name = sample_ws.getInstrument().getName()
SetInstrumentParameter(sample_ws, ComponentName=inst_name,
    ParameterName='Efixed', ParameterType='Number', Value='4.1')

# define example geometries for the Sample and Container
SetSample(sample_ws, Geometry={'Shape': 'Cylinder', 'Height': 4.0, 'Radius': 2.0, 'Center': [0.,0.,0.]},
            Material={'ChemicalFormula': 'Ni', 'MassDensity': 7.0},
            ContainerGeometry={'Shape': 'HollowCylinder', 'Height': 4.0, 'InnerRadius': 2.0,
            'OuterRadius': 3.5},
            ContainerMaterial={'ChemicalFormula': 'V'})

corrections = PaalmanPingsMonteCarloAbsorption(
        InputWorkspace=sample_ws,
        Shape='Preset',
        BeamHeight=2.0,
        BeamWidth=2.0,
        CorrectionsWorkspace='annulus_corr'
    )

# alternatively, run the corrections with the sample material overridden but preset shape used
corrections = PaalmanPingsMonteCarloAbsorption(
        InputWorkspace=sample_ws,
        Shape='Preset',
        BeamHeight=2.0,
        BeamWidth=2.0,
        SampleChemicalFormula='H2-O',
        SampleDensity=1.0,
        CorrectionsWorkspace='annulus_corr'
    )

ass_ws = corrections[0]
assc_ws = corrections[1]
acsc_ws = corrections[2]
acc_ws = corrections[3]

print("Y-Unit Label of " + str(ass_ws.getName()) + ": " + str(ass_ws.YUnitLabel()))
print("Y-Unit Label of " + str(assc_ws.getName()) + ": " + str(assc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acsc_ws.getName()) + ": " + str(acsc_ws.YUnitLabel()))
print("Y-Unit Label of " + str(acc_ws.getName()) + ": " + str(acc_ws.YUnitLabel()))
Y-Unit Label of annulus_corr_ass: Attenuation factor
Y-Unit Label of annulus_corr_assc: Attenuation factor
Y-Unit Label of annulus_corr_acsc: Attenuation factor
Y-Unit Label of annulus_corr_acc: Attenuation factor

References

  1. H. H. Paalman, and C. J. Pings. Numerical Evaluation of X‐Ray Absorption Factors for Cylindrical Samples and Annular Sample Cells, Journal of Applied Physics 33.8 (1962) 2635–2639 doi: 10.1063/1.1729034

Categories: AlgorithmIndex | Workflow\Inelastic | CorrectionFunctions\AbsorptionCorrections | Workflow\MIDAS

Source

Python: PaalmanPingsMonteCarloAbsorption.py