repeating_multilayer
DEFAULTS = {'repetitions': {'description': 'Number of repetitions of the given series of layers', 'value': 1, 'min': 1, 'max': 9999, 'fixed': True}}
module-attribute
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 | |
__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
|
Index of the layer to duplicate. |
required |
Source code in src/easyreflectometry/sample/collections/layer_collection.py
49 50 51 52 53 54 55 56 57 58 59 60 | |
Layer
Bases: BaseCore
Source code in src/easyreflectometry/sample/elements/layers/layer.py
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 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
rho_m_coupled
property
writable
Whether the layer's magnetic SLD is the material's rho_m
(a :class:~easyreflectometry.sample.MaterialMagnetic).
When True, magnetism.rho_m is a dependent parameter following the
current material; the layer keeps its own theta_m. Opt-in: layers of
one material may carry different net moments. Setting it attaches a
default :class:LayerMagnetism when the layer has none, and requires a
material with rho_m. Uncoupling keeps the current value. Removing
the magnetism, or a user unconstrain of rho_m, uncouples.
Only the layer's own wiring counts: a user constraint placed on
rho_m (:func:~easyreflectometry.constraints.constrain) reads as
uncoupled, is saved as the user constraint it is, and is left alone
when the material is later replaced. Setting this to True explicitly
replaces such a constraint with the coupling.
__init__(material=None, thickness=None, roughness=None, name='EasyLayer', unique_name=None, interface=None, magnetism=None, rho_m_coupled=False)
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
|
magnetism
|
Union[LayerMagnetism, None]
|
Magnetic properties of the layer; None for a non-magnetic layer. By default, None. |
None
|
rho_m_coupled
|
bool
|
Take the magnetic SLD from the material (see :attr: |
False
|
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
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 | |
interface(new_interface)
Set the interface; runs generate_bindings and, for a magnetic layer,
enables magnetism on the calculator (raising if it does not support it).
Source code in src/easyreflectometry/sample/elements/layers/layer.py
115 116 117 118 119 120 121 122 | |
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
258 259 260 261 262 263 264 265 266 267 268 269 270 | |
Multilayer
Bases: BaseAssembly
A multi layer is build from a single or a list of Layer or LayerCollection.
The multi layer will arrange the layers as slabs, allowing the reflectometry to be determined from them. The front layer is where the neutron beam starts in, it has an index of 0.
More information about the usage of this assembly is available in the
multilayer documentation_
.. _multilayer documentation: ../sample/assemblies_library.html#multilayer
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
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 | |
__init__(layers=None, name='EasyMultilayer', unique_name=None, interface=None, type='Multi-layer', populate_if_none=True, conformal_thickness=False, conformal_roughness=False)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
populate_if_none
|
Optional[bool]
|
By default, True. |
True
|
unique_name
|
Optional[str]
|
By default, None. |
None
|
layers
|
Union[Layer, list[Layer], LayerCollection, None]
|
The layers that make up the multi-layer. By default, None. |
None
|
name
|
str
|
Name for multi layer. By default, 'EasyMultilayer'. |
'EasyMultilayer'
|
interface
|
Calculator interface. By default, None. |
None
|
|
type
|
str
|
Type of the constructed instance. By default, 'Multi-layer'. |
'Multi-layer'
|
conformal_thickness
|
bool
|
Tie every layer's thickness to the front layer's. Serialization
reads the current graph state through the matching property, so
the ties are rebuilt on |
False
|
conformal_roughness
|
bool
|
Tie every layer's roughness to the front layer's, likewise persistent. By default, False. |
False
|
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
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 | |
add_layer(*layers)
Add a layer to the multi layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*layers
|
tuple[Layer]
|
Layers to add to the multi layer. |
()
|
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
86 87 88 89 90 91 92 93 94 95 96 97 98 | |
duplicate_layer(idx)
Duplicate a given layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
Index of layer to duplicate. |
required |
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
remove_layer(idx)
Remove a layer from the item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
Index of layer to remove. |
required |
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
117 118 119 120 121 122 123 124 125 126 127 | |
from_dict(data)
classmethod
Create a Multilayer from a dictionary.
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
135 136 137 138 139 | |
RepeatingMultilayer
Bases: Multilayer
A repeating multi layer is build from a Multilayer and which it repeats
for a given number of times. This enables a computational efficiency in many
reflectometry engines as the operation can be performed for a single
Multilayer and cheaply combined for the appropriate number of
repetitions.
More information about the usage of this assembly is available in the
repeating multilayer documentation_
.. _repeating multilayer documentation: ../sample/assemblies_library.html#repeatingmultilayer
Source code in src/easyreflectometry/sample/assemblies/repeating_multilayer.py
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 | |
__init__(layers=None, repetitions=None, name='EasyRepeatingMultilayer', unique_name=None, interface=None, populate_if_none=True, conformal_thickness=False, conformal_roughness=False)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
populate_if_none
|
bool
|
By default, True. |
True
|
unique_name
|
Optional[str]
|
By default, None. |
None
|
layers
|
Union[LayerCollection, Layer, list[Layer], None]
|
The layers that make up the multi-layer that will be repeated. By default, None. |
None
|
repetitions
|
Union[Parameter, int, None]
|
Number of repetitions of the given series of layers. By default, None. |
None
|
name
|
str
|
Name for the repeating multi layer. By default, 'EasyRepeatingMultilayer'. |
'EasyRepeatingMultilayer'
|
interface
|
Calculator interface. By default, None. |
None
|
|
conformal_thickness
|
bool
|
Tie every layer's thickness to the front layer's (persisted). By default, False. |
False
|
conformal_roughness
|
bool
|
Tie every layer's roughness to the front layer's (persisted). By default, False. |
False
|
Source code in src/easyreflectometry/sample/assemblies/repeating_multilayer.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 97 98 99 100 101 102 103 104 105 | |
get_as_parameter(name, value, default_dict, unique_name_prefix=None)
This function creates a parameter for the variable name.
A parameter has a value and metadata.
If the value already is a parameter, it is returned. If the value is a number, a parameter is created with this value and metadata from the dictionary. If the value is None, a parameter is created with the default value and metadata from the dictionary.
param value: The value to use for the parameter. If None, the default value in the dictionary is used.
param name: The name of the parameter
param default_dict: Dictionary with entry for `name` containing the default value and metadata for the parameter
Source code in src/easyreflectometry/utils.py
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 | |