Table of Contents
The sample details object holds the user defined properties of the current sample if absorption corrections are required whilst focusing. Only specific instruments support sample absorption corrections. This can be determined from visiting the instrument reference: Instrument Reference. If the instrument has a set_sample_details method it supports sample absorption corrections.
Before you can use absorption corrections you will need to: - Create SampleDetails Object - Setting the material
Optionally you may also:
This method assumes you are familiar with the concept of objects in Python. If not more details can be read here: A quick introduction to objects
For more details on any of the parameters set here see: Set Sample.
Note: this assumes a cylinder geometry
To create a SampleDetails object the following parameters of the sample geometry are required:
from isis_powder import SampleDetails
cylinder_height = 3.0
cylinder_radius = 2.0
cylinder_position = [0.0, 0.0, 0.2]
sample_obj = SampleDetails(height=cylinder_height, radius=cylinder_radius,
center=cylinder_position)
The height of the sample cylinder in cm. This must be a number which is greater than 0.
Example Input:
sample_obj = SampleDetails(height=5.0, ...)
Having successfully defined the geometry (see: Create SampleDetails Object) we now must set the material of the sample.
This can only be set once per object without explicitly calling the reset method or constructing a new object (which is preferred) see: Changing sample properties
The following properties are required to set the sample material:
sample_obj.set_material(chemical_formula="V")
# OR
sample_obj.set_material(chemical_formula="VNb", number_density=123)
The chemical formula of this material. Isotopes can be defined by the ratios as well. For example V 95.1% Nb 4.9% can be expressed as V0.951 Nb0.049.
See: SetSampleMaterial for more details.
Example Input:
sample_obj.set_material(chemical_formula="V")
# Or
sample_obj.set_material(chemical_formula="V0.951 Nb0.049", ...)
This parameter defines the number density of the property. When chemical_formula defines an element this can automatically be calculated by Mantid.
If chemical_formula is not an element the user must enter this value.
Example Input:
sample_obj.set_material(number_density=0.123, ...)
Advanced material properties can be optionally set instead of letting Mantid calculate them. For more details see: SetSampleMaterial This can only be set once per object without explicitly calling the reset method or constructing a new object (which is preferred) see: Changing sample properties
These properties are:
sample_obj.set_material_properties(absorption_cross_section=123,
scattering_cross_section=456)
The absorption cross section for the sample in barns to use whilst calculating absorption corrections.
The scattering cross section for the sample in barns to use whilst calculating absorption corrections.
Warning
This method is not recommended for changing multiple samples. Instead it is recommended you create a new sample details object if you need to change properties mid way through a script. See Create SampleDetails Object and A quick introduction to objects.
Note: The geometry of a sample cannot be changed without creating a new sample details object
Once you have set a material by calling set_material or set the properties by calling set_material_properties you will not be able to change (or set) these details without first resetting the object. This is to enforce the sample properties being set only once so that users are guaranteed of the state.
To change the chemical material or its advanced properties all reset_sample_material. This will reset all details (i.e advanced properties and chemical properties).
sample_obj.reset_sample_material()