Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
.. _isis-powder-diffraction-sampleDetails-ref:
=========================================================
ISIS Powder Diffraction Scripts - SampleDetails Reference
=========================================================
.. contents:: Table of Contents
:local:
Introduction
------------
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:
:ref:`instrument_doc_links_isis-powder-diffraction-ref`.
If the instrument has a *set_sample_details* method it supports sample
absorption corrections.
Before you can use absorption corrections you will need to:
- :ref:`create_sampleDetails_object_isis-powder-diffraction-ref`
- :ref:`set_material_sample_details_isis-powder-diffraction-ref`
Optionally you may also:
- :ref:`set_material_properties_sampleDetails_isis-powder-diffraction-ref`
.. _create_sampleDetails_object_isis-powder-diffraction-ref:
Create SampleDetails Object
------------------------------
This method assumes you are familiar with the concept of objects in Python.
If not more details can be read here: :ref:`intro_to_objects-isis-powder-diffraction-ref`
For more details on any of the parameters set here see:
:ref:`Set Sample<algm-SetSample>`.
**Note: this assumes a cylinder geometry**
To create a SampleDetails object the following parameters of the
sample geometry are required:
- :ref:`height_sampleDetails_isis-powder-diffraction-ref` - Cylinder height
- :ref:`radius_sampleDetails_isis-powder-diffraction-ref` - Cylinder radius
- :ref:`center_sampleDetails_isis-powder-diffraction-ref` - List of x, y, z
positions of the cylinder
Example
^^^^^^^
.. code-block:: Python
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)
.. _height_sampleDetails_isis-powder-diffraction-ref:
height
^^^^^^^
The height of the sample cylinder in cm. This must be a number
which is greater than 0.
Example Input:
.. code-block:: Python
sample_obj = SampleDetails(height=5.0, ...)
.. _radius_sampleDetails_isis-powder-diffraction-ref:
radius
^^^^^^
The radius of the sample cylinder in cm. This must be a number
which is greater than 0.
Example Input:
.. code-block:: Python
sample_obj = SampleDetails(radius=5.0, ...)
.. _center_sampleDetails_isis-powder-diffraction-ref:
center
^^^^^^
The center of the sample cylinder as defined by X, Y and Z
co-ordinates. This co-ordinates must be numeric.
Example Input:
.. code-block:: Python
sample_obj = SampleDetails(center=[-1.0, 0.0, 1.0], ...)
.. _set_material_sample_details_isis-powder-diffraction-ref:
Setting the material
--------------------
Having successfully defined the geometry
(see: :ref:`create_sampleDetails_object_isis-powder-diffraction-ref`)
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: :ref:`changing_sample_properties_sampleDetails_isis-powder-diffraction-ref`
The following properties are required to set the sample material:
- :ref:`chemical_formula_sampleDetails_isis-powder-diffraction-ref`
- :ref:`number_density_sampleDetails_isis-powder-diffraction-ref`
(Optional if *chemical_formula* is an element, otherwise mandatory).
Example
^^^^^^^
.. code-block:: Python
sample_obj.set_material(chemical_formula="V")
# OR
sample_obj.set_material(chemical_formula="VNb", number_density=123)
.. _chemical_formula_sampleDetails_isis-powder-diffraction-ref:
chemical_formula
^^^^^^^^^^^^^^^^
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: :ref:`SetSampleMaterial <algm-SetSampleMaterial>` for
more details.
Example Input:
.. code-block:: Python
sample_obj.set_material(chemical_formula="V")
# Or
sample_obj.set_material(chemical_formula="V0.951 Nb0.049", ...)
.. _number_density_sampleDetails_isis-powder-diffraction-ref:
number_density
^^^^^^^^^^^^^^
This parameter defines the number density of the property.
When :ref:`chemical_formula_sampleDetails_isis-powder-diffraction-ref`
defines an element this can automatically be calculated by Mantid.
If :ref:`chemical_formula_sampleDetails_isis-powder-diffraction-ref`
is not an element the user must enter this value.
Example Input:
.. code-block:: Python
sample_obj.set_material(number_density=0.123, ...)
.. _set_material_properties_sampleDetails_isis-powder-diffraction-ref:
Setting material properties
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Advanced material properties can be optionally set instead of letting
Mantid calculate them. For more details see:
:ref:`SetSampleMaterial<algm-SetSampleMaterial>`
This can only be set once per object without
explicitly calling the reset method or constructing a new object (which is preferred)
see: :ref:`changing_sample_properties_sampleDetails_isis-powder-diffraction-ref`
These properties are:
- :ref:`absorption_cross_section_sampleDetails_isis-powder-diffraction-ref`
- :ref:`scattering_cross_section_sampleDetails_isis-powder-diffraction-ref`
Example
^^^^^^^
.. code-block:: Python
sample_obj.set_material_properties(absorption_cross_section=123,
scattering_cross_section=456)
.. _absorption_cross_section_sampleDetails_isis-powder-diffraction-ref:
absorption_cross_section
^^^^^^^^^^^^^^^^^^^^^^^^
The absorption cross section for the sample in barns to use
whilst calculating absorption corrections.
.. _scattering_cross_section_sampleDetails_isis-powder-diffraction-ref:
scattering_cross_section
^^^^^^^^^^^^^^^^^^^^^^^^
The scattering cross section for the sample in barns to use
whilst calculating absorption corrections.
.. _changing_sample_properties_sampleDetails_isis-powder-diffraction-ref:
Changing sample properties
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. 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 :ref:`create_sampleDetails_object_isis-powder-diffraction-ref`
and :ref:`intro_to_objects-isis-powder-diffraction-ref`.
*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).
.. code-block:: Python
sample_obj.reset_sample_material()