surfactant_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 | |
LayerAreaPerMolecule
Bases: Layer
The LayerAreaPerMolecule class allows a layer to be defined in terms of some
molecular formula an area per molecule, and a solvent.
Source code in src/easyreflectometry/sample/elements/layers/layer_area_per_molecule.py
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 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
area_per_molecule_parameter
property
Get the parameter for area per molecule.
area_per_molecule
property
writable
The Parameter that controls area per molecule.
molecule
property
Get the molecule material.
solvent
property
writable
Get the solvent material.
solvent_fraction_parameter
property
Get parameter for the fraction of the layer occupied by the solvent.
solvent_fraction
property
writable
The Parameter for the fraction of the layer occupied by the solvent.
molecular_formula
property
writable
Get the formula of molecule the layer.
__init__(molecular_formula=None, thickness=None, solvent=None, solvent_fraction=None, area_per_molecule=None, roughness=None, name='EasyLayerAreaPerMolecule', unique_name=None, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
molecular_formula
|
Union[str, None]
|
Formula for the molecule in the layer. By default, None. |
None
|
thickness
|
Union[Parameter, float, None]
|
Layer thickness in Angstrom. By default, None. |
None
|
solvent
|
Union[Material, None]
|
Solvent containing the molecule. By default, None. |
None
|
solvent_fraction
|
Union[Parameter, float, None]
|
Fraction of solvent in layer. Fx solvation or surface coverage. By default, None. |
None
|
area_per_molecule
|
Union[Parameter, float, None]
|
Area per molecule in the layer. 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, 'EasyLayerAreaPerMolecule'. |
'EasyLayerAreaPerMolecule'
|
interface
|
Interface object. By default, None. |
None
|
Source code in src/easyreflectometry/sample/elements/layers/layer_area_per_molecule.py
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 | |
from_dict(obj_dict)
classmethod
Re-route the saved solvent_fraction Parameter and rebuild the
molecule-SLD constraint chain after :class:ModelBase.from_dict
swaps in the persisted Parameter objects.
ModelBase.from_dict writes the deserialized solvent_fraction
Parameter to self._solvent_fraction (orphan — the live property
delegates to self.material.solvent_fraction, which is
self.material._fraction). It also reassigns self._thickness
and self._area_per_molecule, but the constraint graph built in
__init__ still references the temporary Parameters created from
the float kwargs. We fix both here.
Source code in src/easyreflectometry/sample/elements/layers/layer_area_per_molecule.py
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 | |
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.
SurfactantLayer
Bases: BaseAssembly
A surfactant layer constructs a series of layers representing the head and tail groups of a surfactant. This assembly allows the definition of a surfactant or lipid using the chemistry of the head (head_layer) and tail (tail_layer) regions, additionally this approach will make the application of constraints such as conformal roughness or area per molecule more straight forward.
More information about the usage of this assembly is available in the
surfactant documentation_
.. _surfactant documentation: ../sample/assemblies_library.html#surfactantlayer
Source code in src/easyreflectometry/sample/assemblies/surfactant_layer.py
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 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 286 287 288 289 | |
tail_layer
property
writable
Get the tail layer of the surfactant surface.
head_layer
property
writable
Get the head layer of the surfactant surface.
constrain_area_per_molecule
property
writable
Get the area per molecule constraint status.
conformal_roughness
property
writable
Get the roughness constraint status.
__init__(tail_layer=None, head_layer=None, name='EasySurfactantLayer', unique_name=None, constrain_area_per_molecule=False, conformal_roughness=False, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
tail_layer
|
Optional[LayerAreaPerMolecule]
|
Layer representing the tail part of the surfactant layer. By default, None. |
None
|
head_layer
|
Optional[LayerAreaPerMolecule]
|
Layer representing the head part of the surfactant layer. By default, None. |
None
|
name
|
str
|
Name for surfactant layer. By default, 'EasySurfactantLayer'. |
'EasySurfactantLayer'
|
constrain_area_per_molecule
|
bool
|
Constrain the area per molecule. By default, False. |
False
|
conformal_roughness
|
bool
|
Constrain the roughness to be the same for both layers. By default, False. |
False
|
interface
|
Calculator interface. By default, None. |
None
|
Source code in src/easyreflectometry/sample/assemblies/surfactant_layer.py
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 | |
constrain_solvent_roughness(solvent_roughness)
Add the constraint to the solvent roughness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solvent_roughness
|
Parameter
|
The solvent roughness parameter. |
required |
Source code in src/easyreflectometry/sample/assemblies/surfactant_layer.py
190 191 192 193 194 195 196 197 198 199 200 201 | |
constrain_multiple_contrast(another_contrast, head_layer_thickness=True, tail_layer_thickness=True, head_layer_area_per_molecule=True, tail_layer_area_per_molecule=True, head_layer_fraction=True, tail_layer_fraction=True)
Constrain structural parameters between surfactant layer objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tail_layer_fraction
|
bool
|
By default, True. |
True
|
head_layer_fraction
|
bool
|
By default, True. |
True
|
tail_layer_area_per_molecule
|
bool
|
By default, True. |
True
|
head_layer_area_per_molecule
|
bool
|
By default, True. |
True
|
tail_layer_thickness
|
bool
|
By default, True. |
True
|
head_layer_thickness
|
bool
|
By default, True. |
True
|
another_contrast
|
SurfactantLayer
|
The surfactant layer to constrain. |
required |
Source code in src/easyreflectometry/sample/assemblies/surfactant_layer.py
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 | |
to_dict(skip=None)
Serialize, dropping the derived layers field (it is rebuilt
from tail_layer and head_layer in __init__).
Source code in src/easyreflectometry/sample/assemblies/surfactant_layer.py
280 281 282 283 284 285 286 | |