freeform  Freeform  Parametric BSpline¶
A freeform section of the sample modeled with monotonic splines. 

A freeform section of the sample modeled with Bsplines. 

A freeform section of the sample modeled with Bsplines. 
Freeform modeling with BSplines
DEPRECATED Use refl1d.mono instead.
 class refl1d.freeform.FreeInterface(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.
 constraints()¶
Constraints
 find(z)¶
Find the layer at depth z.
Returns layer, start, end
 interface = None¶
 property ismagnetic¶
 layer_parameters()¶
 property magnetism¶
 name = 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.
 property thickness¶
 class refl1d.freeform.FreeLayer(thickness=0, left=None, right=None, rho=(), irho=(), rhoz=(), irhoz=(), name='Freeform')[source]¶
Bases:
Layer
A freeform section of the sample modeled with Bsplines.
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 = None¶
 property ismagnetic¶
 layer_parameters()¶
 property magnetism¶
 name = 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 = None¶
 class refl1d.freeform.FreeformInterface01(thickness=0, interface=0, below=None, above=None, z=None, vf=None, name='Interface')[source]¶
Bases:
Layer
A freeform section of the sample modeled with Bsplines.
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 = None¶
 property ismagnetic¶
 layer_parameters()¶
 property magnetism¶
 name = 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 = None¶