orsopy.fileio.model_complex module

Build-in blocks of physical units used in model to describe more complex systems.

All these need to follow the .model_building_blocks.SubStackType protocol and have a common “sub_stack_class” attribute that has to be set to the class name.

class orsopy.fileio.model_complex.FunctionTwoElements(material1, material2, function, thickness=None, roughness=None, slice_resolution=None, sub_stack_class='FunctionTwoElements', comment=None)[source]

Bases: Header, SubStackType

Models a continuous variation between two materials/SLDs according to an analytical function.

The profile rho(z) is defined according to the relative layer thickness as fraction of material 2:

rho(z) = (1-f((x-x0)/thickness))*rho_1 + f((x-x0)/thickness)*rho_2

f is bracketed between 0 and 1 to prevent any artefacts with SLDs that are non-physical.

The function string is evaluated according to python syntax using only build-in operators and a limited set of mathematical functions and constants defined in the class constant ALLOWED_FUNCTIONS.

TODO: Review class parameters within ORSO.

material1: str
material2: str
function: str
thickness: Union[float, Value, None] = None
roughness: Union[float, Value, None] = None
slice_resolution: Union[float, Value, None] = None
sub_stack_class: Literal['FunctionTwoElements'] = 'FunctionTwoElements'
ALLOWED_FUNCTIONS = ['pi', 'sqrt', 'exp', 'sin', 'cos', 'tan', 'sinh', 'cosh', 'tanh', 'asin', 'acos', 'atan']
resolve_names(resolvable_items)[source]
resolve_defaults(defaults)[source]
Return type:

None

resolve_to_layers()[source]
Return type:

List[Layer]

comment: Optional[str] = None