Sample Transmission Calculator Testing¶
Introduction¶
This is a manual testing guide for the Sample Transmission Calculator (Interfaces > General > Sample Transmission Calculator).
Basic Usage¶
For the Input Wavelength Range at the top of the window select
Single
fromType
dropdown box and set
Low=1.8
Width=1
High=7.8
In sample details set
Chemical Formula = V
Mass Density = 6
Thickness = 0.5
Click
Calculate
button in bottom right - it should produce the following
Select
Number Density
instead ofMass Density
in the sample details and setNumber Density = 0.072
(it should produce an near identical result with transmission ~0.65 at the lowest wavelength).
Multiple atoms in chemical formula¶
In sample details set
Chemical Formula = C2 H4
Mass Density = 0.93
Thickness = 0.015
Click
Calculate
- the transmission should be ~0.9 for all wavelengths (the cross-section is dominated by incoherent scattering rather than absorption - only the latter depends on wavelength).Set
Chemical Formula = C4 H8
and clickCalculate
- the result should not change. This doubles the number of scatterers in a formula unit, but because the mass density is the same it halves the number of formula units in the sample volume.Select
Number Density
instead ofMass Density
in the sample details and setNumber Density = 0.12
(it should produce an near identical result with transmission ~0.9 at the lowest wavelength). This is because the units ofNumber Density
areatoms/Ang^3
notformula units/Ang^3
.Set
Chemical Formula = C2 D4
andCalculate
- the transmission should be ~1 (deuterium has a much smaller incoherent cross-section than hydrogen).
Validation of Single Wavelength Range¶
For each of the following instructions there should be a warning message in red at the bottom of the window.
Try setting
Low > High
Try setting
Width > (High - Low)
Try setting
Width = 0
It should not allow you to input the following in the spin-boxes (no warning will be printed).
Negative numbers
Punctuation
Non-numeric characters (including punctuation)
If you delete the contents of a box and then click Calculate
it will reset it with the previously entered values.
Multiple Wavelength Range¶
For the Input Wavelength Range at the top of the window select
Multiple
fromType
dropdown boxIn the
Multiple
edit box enter1,1,3
and clickCalculate
Right-click on the
transmission_ws
workspace in the main workbench window andShow Data
- you should see that there are 2 bins at wavelengths1.5 Ang
and2.5 Ang
In the
Multiple
edit box enter1,1,3,0.5,4
and clickCalculate
- in the workspace data table you should see additional bins at3.25 Ang
and3.75 Ang
Repeat the validation tests in Validation of Single Wavelength Range
Chemical Formula Validation¶
The following should produce a warning at the bottom of the window and throw an error from CalculateSampleTransmission
Set
Chemical Formula = C2H4
(i.e. remove the space)Set
Chemical Formula = Z
Set
Chemical Formula = 0
Set
Chemical Formula = *
Set
Chemical Formula = 2C 4H