refellips.structureSE

class refellips.structureSE.ComponentSE(name='')

Bases: Component

A base class for describing the structure of a subset of an interface.

Parameters:

name (str, optional) – The name associated with the Component

Notes

By setting the Component.interfaces property one can control the type of interfacial roughness between all the layers of an interfacial profile.

class refellips.structureSE.MixedSlabSE(thick, ri_A, ri_B, vf_B, rough, name='', interface=None)

Bases: ComponentSE

A slab component made of two materials.

Parameters:
  • thick (refnx.analysis.Parameter or float) – thickness of slab (Angstrom)

  • ri_A (ScattererSE) – refractive index of first material

  • ri_B (ScattererSE) – refractive index of second material

  • vf_B (float) – volume fraction of B in the layer. Volume fraction of A is calculated as 1 - vf_B.

  • rough (refnx.analysis.Parameter or float) – roughness on top of this slab (Angstrom)

  • name (str) – Name of this slab

  • interface ({Interface, None}, optional) – The type of interfacial roughness associated with the Slab. If None, then the default interfacial roughness is an Error function (also known as Gaussian roughness).

property parameters

refnx.analysis.Parameters associated with this component

slabs(structure=None)

Slab representation of this component. See Component.slabs

class refellips.structureSE.ScattererSE(name='', wavelength=None)

Bases: Scatterer

Abstract base class for something that will have a refractive index. Inherited from refnx.reflect.structure.Scatterer

complex(wavelength)

Calculate a complex RI

Parameters:

wavelength (float) – wavelength of light in nm

Returns:

RI – refractive index and extinction coefficient

Return type:

complex

class refellips.structureSE.SlabSE(thick, ri, rough, name='', vfsolv=0, interface=None)

Bases: ComponentSE

A slab component has uniform refractive index over its thickness

Parameters:
  • thick (refnx.analysis.Parameter or float) – thickness of slab (Angstrom)

  • ri (refellips.ScattererSE) – (complex) RI of film

  • rough (refnx.analysis.Parameter or float) – roughness on top of this slab (Angstrom)

  • name (str) – Name of this slab

  • vfsolv (refnx.analysis.Parameter or float) – Volume fraction of solvent [0, 1]

  • interface ({Interface, None}, optional) – The type of interfacial roughness associated with the Slab. If None, then the default interfacial roughness is an Error function (also known as Gaussian roughness).

property parameters

refnx.analysis.Parameters associated with this component

slabs(structure=None)

Slab representation of this component. See ComponentSE.slabs

class refellips.structureSE.StructureSE(components=(), name='', solvent=None, reverse_structure=False, contract=0, wavelength=None, ema='linear', depolarisation_factor=0.3333333333333333)

Bases: Structure

Represents the interfacial Structure of an Ellipsometry sample. Successive Components are added to the Structure to construct the interface.

Parameters:
  • components (sequence) – A sequence of ComponentSE to initialise the Structure.

  • name (str) – Name of this structure

  • solvent (ScattererSE) – Specifies the refractive index of the solvent used for solvation. If no solvent is specified then the RI of the solvent is assumed to be the RI of Structure[-1].slabs()[-1] (after any possible slab order reversal).

  • reverse_structure (bool) – If StructureSE.reverse_structure is True then the slab representation produced by StructureSE.slabs is reversed. The sld profile and calculated reflectivity will correspond to this reversed structure.

  • contract (float) – If contract > 0 then an attempt to contract/shrink the slab representation is made. Use larger values for coarser profiles (and vice versa). A typical starting value to try might be 1.0.

  • wavelength (float, None) – Wavelength the sample was measured at.

  • ema ({'linear', 'maxwell-garnett', 'bruggeman'}) – Specifies the effective medium approximation for how the RI of a Component is mixed with the RI of the solvent. Further details regarding mixing are explained in the slabs method.

  • depolarisation_factor (float, int) – The depolarisation factor is used only in the EMA calculations for the Maxwell-Garnett and Bruggeman methods. It describes the electric field screening: 0 prescribing no screening and 1 prescribing maximum screening.

append(item)

Append a Component to the Structure.

Parameters:

item (refnx.reflect.Component) – The component to be added.

contract

float if contract > 0 then an attempt to contract/shrink the slab representation is made. Use larger values for coarser profiles (and vice versa). A typical starting value to try might be 1.0.

property depolarisation_factor
overall_ri(slabs, solvent)

Calculates the overall refractive index of the material and solvent RI in a layer.

Parameters:
  • slabs (np.ndarray) – Slab representation of the layers to be averaged.

  • solvent (complex or ScattererSE) – RI of solvating material.

Returns:

averaged_slabs – the averaged slabs.

Return type:

np.ndarray

plot(pvals=None, samples=0, fig=None, align=0)

Plot the structure.

Requires matplotlib be installed.

Parameters:
  • pvals (np.ndarray, optional) – Numeric values for the Parameter’s that are varying

  • samples (number) – If this structures constituent parameters have been sampled, how many samples you wish to plot on the graph.

  • fig (Figure instance, optional) – If fig is not supplied then a new figure is created. Otherwise the graph is created on the current axes on the supplied figure.

  • align (int, optional) – Aligns the plotted structures around a specified interface in the slab representation of a Structure. This interface will appear at z = 0 in the sld plot. Note that Components can consist of more than a single slab, so some thought is required if the interface to be aligned around lies in the middle of a Component. Python indexing is allowed, e.g. supplying -1 will align at the backing medium.

Returns:

fig, axmatplotlib figure and axes objects.

Return type:

matplotlib.Figure, matplotlib.Axes

reflectivity()

Calculate theoretical reflectivity of this structure

Parameters:
  • q (array-like) – Q values (Angstrom**-1) for evaluation

  • threads (int, optional) – Specifies the number of threads for parallel calculation. This option is only applicable if you are using the _creflect module. The option is ignored if using the pure python calculator, _reflect. If threads == 0 then all available processors are used.

  • spin (refnx.reflect.SpinChannel) – Enum specifying which spin-state to calculate. None is unpolarised.

Returns:

reflectivity – Reflectivity corresponding to each of the Q-points.

Return type:

np.ndarray

Notes

Normally the reflectivity will be calculated using the Nevot-Croce approximation for Gaussian roughness between different layers. However, if individual components have non-Gaussian roughness (e.g. Tanh), then the overall reflectivity and SLD profile are calculated by micro-slicing. Micro-slicing involves calculating the specific SLD profile, dividing it up into small-slabs, and calculating the reflectivity from those. This normally takes much longer than the Nevot-Croce approximation. To speed the calculation up the Structure.contract property can be used.

ri_profile(z=None, align=0, max_delta_z=None)

Calculates an RI profile, as a function of distance through the interface.

Parameters:
  • z (float) – Interfacial distance (Angstrom) measured from interface between the fronting medium and the first layer.

  • align (int, optional) – Places a specified interface in the slab representation of a Structure at z = 0. Python indexing is allowed, e.g. supplying -1 will place the backing medium at z = 0.

  • max_delta_z ({None, float}, optional) – If specified this will control the maximum spacing between SLD points. Only used if z is None.

Returns:

ri – refractive index

Return type:

float

Notes

This can be called in vectorised fashion.

slabs(**kwds)

The slab representation of this structure.

Returns:

slabs – Slab representation of this structure. Has shape (N, 5).

  • slab[N, 0]

    thickness of layer N

  • slab[N, 1]

    overall RI.real of layer N (material AND solvent)

  • slab[N, 2]

    overall RI.imag of layer N (material AND solvent)

  • slab[N, 3]

    roughness between layer N and N-1

  • slab[N, 4]

    volume fraction of solvent in layer N.

Return type:

np.ndarray

Notes

If Structure.reversed is True then the slab representation order is reversed. The slab order is reversed before the solvation calculation is done. I.e. if Structure.solvent == ‘backing’ and Structure.reversed is True then the material that solvates the system is the component in Structure[0], which corresponds to Structure.slab[-1].

Users can simulate mixing between two adjacent layers by specifying a volume fraction of solvent (vfsolv). The overall_ri function then performs the EMA using the specified method: ‘linear’, ‘maxwell-garnett’ or ‘bruggeman’. All EMA calculations are performed by using the complex dielectric function (i.e., square of refractive index and extinction coefficient). For a host layer (e_h) with volume fraction (vf) of impurities (e_i), the overall RI is calculated by

>>> StructureSE.ema = 'linear'
e_linear = e_h * (1 - vf) + e_i * vf
>>> StructureSE.ema = 'maxwell-garnett'
>>> StructureSE.depolarisation_factor = 1/3
top = e_h + (depolarisation_factor * (1 - vf) + vf) * (e_i - e_h)
bottom = e_h + depolarisation_factor * (1 - vf) * (e_i - e_h)
e_MG = e_h * top_r / bottom_r
>>> StructureSE.ema = 'bruggeman'
>>> StructureSE.depolarisation_factor = 1/3
b = e_h * ((1 - vf) - depolarisation_factor) + e_i * (vf - depolarisation_factor)
e_BG = (b + np.sqrt(b**2 - 4 * (depolarisation_factor - 1) *
                         (vf * e_h * e_i * depolarisation_factor
                          ))) / (2 * (1 - depolarisation_factor))
sld_profile = None
property solvent
refellips.structureSE.nm_eV_conversion(val)

Convert wavelength from nm to eV -or- Convert wavelength from nm to eV

It does both. Visible light has a range of energies from 1.77 (red) to 3.26 (blue) eV

refellips.structureSE.overall_ri(ri_A, ri_B, vf_B=0.0, ema='linear', depolarisation_factor=0.3333333333333333)

Calculates the overall refractive index of two materials.

Parameters:
  • ri_A (complex, array-like) – RI of material A

  • ri_B (complex) – RI of material B

  • vf_B (float, optional) – volume fraction of material B. The volume fraction of A is calculated as 1 - vf_B.

  • ema ({'linear', 'maxwell-garnett', 'bruggeman'}) – Specifies how refractive indices are mixed together.

  • depolarisation_factor (float, optional) – Depolarisation factor. Default is 1/3.

Returns:

ri_avg – the averaged material RI

Return type:

complex