sample.layers - Models of Reflectivity Layer Structure¶
Repeat a layer or stack. |
|
A block of material. |
|
Reflectometry layer stack |
|
Component of a material description. |
Reflectometry models
Reflectometry models consist of 1-D stacks of layers. Layers are joined by gaussian interfaces. The layers themselves may be uniform, or the scattering density may vary with depth in the layer.
Note
By importing model, the definition of material.Scatterer
changes so that materials can be stacked into layers using operator
overloading:
- the | operator, (previously known as “bitwise or”) joins stacks
- the * operator repeats stacks (n times, n is an int)
This will affect all instances of the Scatterer class, and all of its subclasses.
- class refl1d.sample.layers.Layer[source]¶
Bases:
object
Component of a material description.
- thickness (Parameter: angstrom)
Thickness of the layer
- interface (Parameter: angstrom)
Interface for the top of the layer.
- magnetism (Magnetism info)
Magnetic profile anchored to the layer.
- interface: Parameter | None = None¶
- property ismagnetic¶
- magnetism: BaseMagnetism | None = None¶
- name: str¶
- parameters()[source]¶
Returns a dictionary of parameters specific to the layer. These will be added to the dictionary containing interface, thickness and magnetism parameters.
- penalty()[source]¶
Return a penalty value associated with the layer. This should be zero if the parameters are valid, and increasing as the parameters become more invalid. For example, if total volume fraction exceeds unity, then the penalty would be the amount by which it exceeds unity, or if z values must be sorted, then penalty would be the amount by which they are unsorted.
Note that penalties are handled separately from any probability of seeing a combination of layer parameters; the final solution to the problem should not include any penalized points.
- thickness: Parameter¶
- class refl1d.sample.layers.Repeat(stack, repeat=1, interface=None, name=None, magnetism=None, thickness: Parameter | None = None)[source]¶
Bases:
Layer
Repeat a layer or stack.
If an interface parameter is provide, the roughness between the multilayers may be different from the roughness between the repeated stack and the following layer.
Note: Repeat is not a type of Stack, but it does have a stack inside.
- constraints()¶
Constraints
- interface: Parameter = None¶
- property ismagnetic¶
- layer_parameters()¶
- magnetism: BaseMagnetism | None = None¶
- name: str¶
- parameters()[source]¶
Returns a dictionary of parameters specific to the layer. These will be added to the dictionary containing interface, thickness and magnetism parameters.
- penalty()[source]¶
Return a penalty value associated with the layer. This should be zero if the parameters are valid, and increasing as the parameters become more invalid. For example, if total volume fraction exceeds unity, then the penalty would be the amount by which it exceeds unity, or if z values must be sorted, then penalty would be the amount by which they are unsorted.
Note that penalties are handled separately from any probability of seeing a combination of layer parameters; the final solution to the problem should not include any penalized points.
- repeat: Parameter¶
- thickness: Parameter¶
- class refl1d.sample.layers.Slab(material=None, thickness=0, interface=0, name=None, magnetism=None)[source]¶
Bases:
Layer
A block of material.
- constraints()¶
Constraints
- find(z)¶
Find the layer at depth z.
Returns layer, start, end
- interface: Parameter | None = None¶
- property ismagnetic¶
- layer_parameters()¶
- magnetism: BaseMagnetism | None = None¶
- material: SLD | BulkDensityMaterial | NaturalDensityMaterial | NumberDensityMaterial | RelativeDensityMaterial | CellVolumeMaterial | Vacuum¶
- name: str¶
- parameters()[source]¶
Returns a dictionary of parameters specific to the layer. These will be added to the dictionary containing interface, thickness and magnetism parameters.
- penalty()¶
Return a penalty value associated with the layer. This should be zero if the parameters are valid, and increasing as the parameters become more invalid. For example, if total volume fraction exceeds unity, then the penalty would be the amount by which it exceeds unity, or if z values must be sorted, then penalty would be the amount by which they are unsorted.
Note that penalties are handled separately from any probability of seeing a combination of layer parameters; the final solution to the problem should not include any penalized points.
- thickness: Parameter¶
- class refl1d.sample.layers.Stack(layers: Stack | List[Slab | Repeat] | None = None, name: str = 'Stack', interface=None, thickness: float | Parameter | None = None)[source]¶
Bases:
Layer
Reflectometry layer stack
A reflectometry sample is defined by a stack of layers. Each layer has an interface describing how the top of the layer interacts with the bottom of the overlaying layer. The stack may contain
- constraints()¶
Constraints
- insert(idx, other)[source]¶
Insert structure into a stack. If the inserted element is another stack, the stack will be expanded to accommodate. You cannot make nested stacks.
- interface: Literal[None] = None¶
- property ismagnetic¶
- layer_parameters()¶
- property layers¶
- magnetism: BaseMagnetism | None = None¶
- name: str¶
- parameters()[source]¶
Returns a dictionary of parameters specific to the layer. These will be added to the dictionary containing interface, thickness and magnetism parameters.
- penalty()[source]¶
Return a penalty value associated with the layer. This should be zero if the parameters are valid, and increasing as the parameters become more invalid. For example, if total volume fraction exceeds unity, then the penalty would be the amount by which it exceeds unity, or if z values must be sorted, then penalty would be the amount by which they are unsorted.
Note that penalties are handled separately from any probability of seeing a combination of layer parameters; the final solution to the problem should not include any penalized points.
- thickness: Parameter¶