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

Table of Contents

Name | Direction | Type | Default | Description |
---|---|---|---|---|

SampleWorkspace | Input | MatrixWorkspace | Mandatory |
Name for the input Sample workspace. |

CorrectionsWorkspace | Input | WorkspaceGroup | Name for the input Corrections workspace. | |

CanWorkspace | Input | MatrixWorkspace | Name for the input Can workspace. | |

CanScaleFactor | Input | number | 1 | Factor to scale the can data |

CanShiftFactor | Input | number | 0 | Amount by which to shift the container data |

OutputWorkspace | Output | MatrixWorkspace | Mandatory |
The output corrections workspace. |

RebinCanToSample | Input | boolean | True | Enable or disable RebinToWorkspace on CanWorkspace. |

Applies absorption corrections calculated in the Paalman and Pings
absorption factor format. The various partial absorption factors are
denoted as \(A_{a,b}\) where the subscript \(a\) denotes the
component the neutron is scattered from and \(b\) denotes the
component where the neutron is absorbed. The various partial
absorption factors, and what their names must contain in the
`CorrectionsWorkspace`

group are detailed in the table below. If any
of the partial absorption factors are not supplied, they are assumed
to be one.

Symbol | Scatter From | Absorbed By | Workspace Name |
---|---|---|---|

\(A_{s,s}\) | sample | sample | `ass` |

\(A_{s,sc}\) | sample | sample and container | `assc` |

\(A_{c,c}\) | container | container | `acc` |

\(A_{c,sc}\) | container | sample and container | `acsc` |

This algorithm can be used to apply absorption corrections calculated with PaalmanPingsMonteCarloAbsorption. It can also be used to apply absorption corrections calculated with either the CylinderPaalmanPingsCorrection or FlatPlatePaalmanPingsCorrection algorithms as well as the legacy indirect calculate corrections routine, providing that the sample and container are first converted to wavelength and the corrections are interpolated to match the sample as demonstrated in the example below.

All workspaces are converted into wavelength using the appropriate
mode of ConvertUnits. Then
`CanShiftFactor`

is added to wavelength of the `CanWorkspace`

.
Then one of the two following equations is performed
(dependent on the number of correction factors provided):

\[I_s = \frac{1}{A_{s,sc}} \left( I_{sc}^E - I_c^E K_c \frac{A_{c,sc}}{A_{c,c}} \right)\]

\[I_s = \frac{1}{A_{s,s}} \left( I_{sc}^E \right) - \frac{1}{A_{c,c}} \left( I_{c}^E \right)\]

The variables that are not defined above are

Variable | Parameter Name | Default |
---|---|---|

\(I_s\) | `OutputWorkspace` |
N/A |

\(I_{sc}^E\) | `SampleWorkspace` |
N/A |

\(I_{c}^E\) | `CanWorkspace` |
0 |

\(K_c\) | `CanScaleFactor` |
1 |

\(A_{a,b}\) | `CorrectionsWorkspace` |
1 |

The workflow diagrams below are another representation of the equation above with the simplifications for when the various terms are missing or one.

Depending on the input workspaces and correction factors provided to the algorithm it may operate in one of four ways, each of which is described on a separate workflow diagram.

In the case where only a container workspace and no correction factors are provided.

In the case where only correction factors and no container workspace is provided.

In the case where a container workspace, along with the \(A_{s,s}\) and \(A_{c, c}\) factors are provided.

In the case where a container workspace, along with the \(A_{s,sc}\), \(A_{c,c}\) and \(A_{c,sc}\) factors are provided.

**Example: using with legacy indirect corrections data**

```
# Load the sample and can
sample_ws = Load('irs26176_graphite002_red.nxs')
can_ws = Load('irs26173_graphite002_red.nxs')
# Convert sample and container workspaces to wavelength
sample_ws = ConvertUnits(InputWorkspace=sample_ws,
Target='Wavelength',
EMode='Indirect',
EFixed=1.845)
can_ws = ConvertUnits(InputWorkspace=can_ws,
Target='Wavelength',
EMode='Indirect',
EFixed=1.845)
# Load the corrections workspace
corrections_ws = Load('irs26176_graphite002_cyl_Abs.nxs')
# Interpolate each of the correction factor workspaces to match the
# binning of the sample
# Required to use corrections from the old indirect calculate
# corrections routines
for factor_ws in corrections_ws:
SplineInterpolation(WorkspaceToMatch=sample_ws,
WorkspaceToInterpolate=factor_ws,
OutputWorkspace=factor_ws,
OutputWorkspaceDeriv='')
corr = ApplyPaalmanPingsCorrection(SampleWorkspace=sample_ws,
CorrectionsWorkspace=corrections_ws,
CanWorkspace=can_ws)
print('Corrected workspace has {} spectra over {} bins'.format(corr.getNumberHistograms(), corr.blocksize()))
print('Type of correction applied: {}'.format(corr.getRun()['corrections_type'].value))
```

Output:

```
Corrected workspace has 10 spectra over 1905 bins
Type of correction applied: sample_and_can_corrections
```

- 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\MIDAS