freeform - Freeform - Parametric B-Spline

FreeInterface

A freeform section of the sample modeled with monotonic splines.

FreeLayer

A freeform section of the sample modeled with B-splines.

FreeformInterface01

A freeform section of the sample modeled with B-splines.

Freeform modeling with B-Splines

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.

render(probe, slabs)[source]

Use the probe to render the layer into a microslab representation.

property thickness
to_dict()[source]

Return a dictionary representation of the Slab object

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 B-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 = 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.

render(probe, slabs)[source]

Use the probe to render the layer into a microslab representation.

thickness = None
to_dict()[source]

Return a dictionary representation of the Slab object

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 B-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 = 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.

render(probe, slabs)[source]

Use the probe to render the layer into a microslab representation.

thickness = None
to_dict()[source]

Return a dictionary representation of the Slab object