gradient_layer
LayerCollection
Bases: BaseCollection
Source code in src/easyreflectometry/sample/collections/layer_collection.py
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 | |
__init__(*layers, name='EasyLayerCollection', interface=None, unique_name=None, populate_if_none=True, **kwargs)
Init function.
Source code in src/easyreflectometry/sample/collections/layer_collection.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
add_layer(layer=None)
Add a layer to the collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
Optional[Layer]
|
Layer to add. By default, None. |
None
|
Source code in src/easyreflectometry/sample/collections/layer_collection.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
duplicate_layer(index)
Duplicate a layer in the collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
|
required |
layer
|
Assembly to add. |
required |
Source code in src/easyreflectometry/sample/collections/layer_collection.py
49 50 51 52 53 54 55 56 57 58 59 60 61 | |
Layer
Bases: BaseCore
Source code in src/easyreflectometry/sample/elements/layers/layer.py
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 | |
__init__(material=None, thickness=None, roughness=None, name='EasyLayer', unique_name=None, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
material
|
Union[Material, None]
|
The material for the layer. By default, None. |
None
|
thickness
|
Union[Parameter, float, None]
|
Layer thickness in Angstrom. By default, None. |
None
|
roughness
|
Union[Parameter, float, None]
|
Upper roughness on the layer in Angstrom. By default, None. |
None
|
name
|
str
|
Name of the layer. By default, 'EasyLayer'. |
'EasyLayer'
|
interface
|
Interface object. By default, None. |
None
|
Source code in src/easyreflectometry/sample/elements/layers/layer.py
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 | |
assign_material(material)
Assign a material to the layer interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
material
|
Material
|
The material to assign to the layer. |
required |
Source code in src/easyreflectometry/sample/elements/layers/layer.py
122 123 124 125 126 127 128 129 130 131 132 | |
Material
Bases: BaseCore
Source code in src/easyreflectometry/sample/elements/materials/material.py
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 | |
__init__(sld=None, isld=None, name='EasyMaterial', unique_name=None, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
sld
|
Union[Parameter, float, None]
|
Real scattering length density. By default, None. |
None
|
isld
|
Union[Parameter, float, None]
|
Imaginary scattering length density. By default, None. |
None
|
name
|
str
|
Name of the material. By default, 'EasyMaterial'. |
'EasyMaterial'
|
interface
|
Calculator interface. By default, None. |
None
|
Source code in src/easyreflectometry/sample/elements/materials/material.py
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 | |
BaseAssembly
Bases: BaseCore
Assembly of layers.
The front layer (front_layer) is the layer the neutron beam starts in, it has an index of 0. The back layer (back_layer) is the final layer from which the unreflected neutron beam is transmitted, its index number depends on the number of finite layers in the system, but it might be accessed at index -1.
Source code in src/easyreflectometry/sample/assemblies/base_assembly.py
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 | |
type
property
Get type of the assembly.
Needed by the GUI.
front_layer
property
writable
Get the front layer in the assembly.
back_layer
property
writable
Get the back layer in the assembly.
GradientLayer
Bases: BaseAssembly
A set of discrete gradient layers changing from the front to the back material.
The front layer is where the neutron beam starts in, it has an index of 0.
Source code in src/easyreflectometry/sample/assemblies/gradient_layer.py
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 | |
thickness
property
writable
Get the thickness of the gradient layer in Angstrom.
roughness
property
writable
Get the Roughness of the gradient layer in Angstrom.
__init__(front_material=None, back_material=None, thickness=2.0, roughness=0.2, discretisation_elements=10, name='EasyGradienLayer', unique_name=None, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
front_material
|
Optional[Material]
|
Material of front of the layer. By default, None. |
None
|
back_material
|
Optional[Material]
|
Material of back of the layer. By default, None. |
None
|
thickness
|
Optional[float]
|
Thicknkess of the layer. By default, 2.0. |
2.0
|
roughness
|
Optional[float]
|
Roughness of the layer. By default, 0.2. |
0.2
|
discretisation_elements
|
int
|
Number of discrete layers. By default, 10. |
10
|
name
|
str
|
Name for gradient layer. By default, 'EasyGradienLayer'. |
'EasyGradienLayer'
|
interface
|
Calculator interface. By default, None. |
None
|
Source code in src/easyreflectometry/sample/assemblies/gradient_layer.py
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 | |
to_dict(skip=None)
Produces a cleaned dict using a custom to_dict method to skip necessary things.
The resulting dict matches the parameters in init: layers are derived
in __init__ from front_material/back_material/discretisation_elements
so they are excluded from the serialized representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip
|
Optional[list[str]]
|
List of keys to skip. By default, None. |
None
|
Source code in src/easyreflectometry/sample/assemblies/gradient_layer.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
as_dict(skip=None)
Compatibility alias for :meth:to_dict.
Source code in src/easyreflectometry/sample/assemblies/gradient_layer.py
168 169 170 | |
_linear_gradient(front_value, back_value, discretisation_elements)
Linear gradient.
Source code in src/easyreflectometry/sample/assemblies/gradient_layer.py
173 174 175 176 177 178 179 180 181 182 183 184 185 | |
_prepare_gradient_layers(front_material, back_material, discretisation_elements, interface=None)
Prepare gradient layers.
Source code in src/easyreflectometry/sample/assemblies/gradient_layer.py
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 | |