sample.mono - Freeform - Monotonic Spline¶
A freeform section of the sample modeled with monotonic splines. |
|
A freeform section of the sample modeled with splines. |
|
Monotonic spline modeling for free interfaces
- class refl1d.sample.mono.FreeInterface(thickness=0, interface=0, below=None, above=None, dz=None, dp=None, name='Interface')[source]¶
Bases:
Layer
A freeform section of the sample modeled with monotonic splines.
Layers have a slope of zero at the ends, so the automatically blend with slabs.
- above: Any | None¶
- below: Any | None¶
- constraints()¶
Constraints
- dp: List[float | Parameter]¶
- dz: List[float | Parameter]¶
- find(z)¶
Find the layer at depth z.
Returns layer, start, end
- interface: Parameter = None¶
- property ismagnetic¶
- layer_parameters()¶
- magnetism: BaseMagnetism | None = None¶
- name: str | None¶
- 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.mono.FreeLayer(below=None, above=None, thickness=0, z=(), rho=(), irho=(), name='Freeform')[source]¶
Bases:
Layer
A freeform section of the sample modeled with splines.
sld (rho) and imaginary sld (irho) can be modeled with a separate number of control points. The control points can be equally spaced in the layers unless rhoz or irhoz are specified. If the z values are given, they must be in the range [0, 1]. One control point is anchored at either end, so there are two fewer z values than controls if z values are given.
Layers have a slope of zero at the ends, so the automatically blend with slabs.
- 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¶
- 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¶