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

CalculateSampleTransmission v1

../_images/CalculateSampleTransmission-v1_dlg.png

CalculateSampleTransmission dialog.

Summary

Calculates the scattering & transmission for a given sample material and size over a given wavelength range.

See Also

SetSampleMaterial

Properties

Name

Direction

Type

Default

Description

WavelengthRange

Input

string

Mandatory

Wavelength range to calculate transmission for.

ChemicalFormula

Input

string

Mandatory

Sample chemical formula

DensityType

Input

string

Mass Density

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

Density

Input

number

0.1

Mass density (g/cm^3) or Number density (atoms/Angstrom^3). Default=0.1

Thickness

Input

number

0.1

Sample thickness (cm). Default=0.1

OutputWorkspace

Output

MatrixWorkspace

Mandatory

Outputs the sample transmission over the wavelength range as a function of wavelength.

Description

Calculates the theoretical scattering & transmission for a given sample over a given wavelength range.

The sample chemical formula is input for the SetSampleMaterial algorithm to calculate the cross-sections. The sample mass density/number density & thickness is input to then calculate the percentage scattering & transmission.

A flat plate sample which is perpendicular to the beam is assumed.

Usage

Example - Running CalculateSampleTransmission.

ws = CalculateSampleTransmission(WavelengthRange='2.0, 0.1, 10.0',
                                 ChemicalFormula='H2-O')

print('Transmission: {:.6f}, {:.6f}, {:.6f} ...'.format(*ws.readY(0)[:3]))
print('Scattering: {:.6f}, {:.6f}, {:.6f} ...'.format(*ws.readY(1)[:3]))

Output:

Transmission: 0.945063, 0.945051, 0.945040 ...
Scattering: 0.054697, 0.054697, 0.054697 ...

Example - Running CalculateSampleTransmission with a specified number density and thickness.

ws = CalculateSampleTransmission(WavelengthRange='2.0, 0.1, 10.0',
                                 ChemicalFormula='H2-O',
                                 DensityType='Number Density',
                                 Density=0.2,
                                 Thickness=0.58)

print('Transmission: {:.6f}, {:.6f}, {:.6f} ...'.format(*ws.readY(0)[:3]))
print('Scattering: {:.6f}, {:.6f}, {:.6f} ...'.format(*ws.readY(1)[:3]))

Output:

Transmission: 0.001450, 0.001448, 0.001446 ...
Scattering: 0.998506, 0.998506, 0.998506 ...

Categories: AlgorithmIndex | Sample

Source

Python: CalculateSampleTransmission.py