Layer

class nexus.Layer(thickness, material=None, roughness=0.0, thickness_fwhm=0, id='', composition=None, density=None)

Constructor for Layer class. When a material is provided, the composition and density arguments must be None. If the Layer constructor should initialize the material as well, set material to None and specify composition and density.

Parameters:
  • thickness (float or Var) – Thickness of the layer (nm).

  • material (Material) – Material of the layer.

  • roughness (float or Var) – Roughness (\(\sigma\)) of the layer in grazing incidence geometry (nm).

  • thickness_fwhm (float or Var) – FWHM of a thickness distribution of the layer for samples in forward geometry (nm). If set to zero no thickness distribution is taken into account. The user must specify a number of points used for the distribution in the corresponding Measurement in order to take the thickness distribution into account.

  • id (string) – User identifier.

  • composition (list) – List of elements of the material to be created by the layer constructor. See material.

  • density (float or Var) – Density (g/cm 3) of the Material to be created by the Layer constructor.

id

User identifier.

Type:

string

thickness

Thickness of the layer (nm).

Type:

Var

material

Material of the layer.

Type:

Material

roughness

Roughness (\(\sigma\)) of the layer (nm).

Type:

Var

thickness_fwhm

FWHM of a thickness distribution of the layer for samples in forward geometry (nm). If set to zero no thickness distribution is taken into account. The user must specify a number of points used for the distribution in the corresponding Measurement in order to take the thickness distribution into account.

Type:

float or Var

composition

List of elements of the material to be created by the layer constructor. See material.

Type:

list

density

Density (g/cm 3) of the material.

Type:

Var

CriticalAngle(energy)

Critical angle of the layer, see Eq. (4.22), [Roehlsberger].

New in version 1.0.3.

Parameters:

energy (float) – X-ray energy (eV).

Returns:

Critical angle (rad).

Return type:

float

ElectronicForwardScatteringFactor(energy)

Pure electronic forward scattering factor of the layer. Scalar version of Eq. (4.4), [Roehlsberger].

Parameters:

energy (float) – X-ray energy (eV).

Returns:

Electronic scattering factor of the layer.

Return type:

complex

ElectronicForwardTransmission(energy)

Pure electronic transmission of the X-ray intensity through the layer. Absolute of the scalar version of Eq. (4.16), [Roehlsberger].

Parameters:

energy (float) – X-ray energy (eV).

Returns:

Electronic transmission of the layer.

Return type:

float

ElectronicGrazingLayerMatrix(scattering_factor, kvector_z)

Pure electronic layer matrix L. 2x2 matrix, Eq. (4.23), [Roehlsberger].

Parameters:
  • scattering_factor (complex) – Complex scattering factor of the layer.

  • kvector_z (float) – k vector along z direction.

Returns:

List of complex 2x2 electronic layer matrices.

Return type:

list

ElectronicGrazingScatteringFactor(energy, angle)

Pure electronic grazing incidence scattering factor in grazing incidence geometry. Scalar version of Eq. (4.25), [Roehlsberger].

Parameters:
  • energy (float) – X-ray energy (eV).

  • angle (float) – Incidence angle (degree).

Returns:

Electronic scattering factor of the layer.

Return type:

complex

ElectronicRefractiveIndex(energy)

Pure electronic refractive index of the layer. Scalar version of Eq. (4.5), [Roehlsberger].

Parameters:

energy (float) – X-ray energy (eV).

Returns:

Refractive index of the layer.

Return type:

complex

ForwardPropagationMatrix(isotope, detuning)

Forward propagation matrix F of the layer, Eq. (4.6), [Roehlsberger].

Parameters:
  • isotope (MoessbauerIsotope) – Resonant isotope.

  • detuning (list or ndarray) – Detuning values, in units of resonant isotope linewidth.

Returns:

List of complex 2x2 propagation matrices.

Return type:

list

ForwardScatteringMatrix(isotope, detuning, calc_transitions)

Forward scattering matrix f of the layer, Eq. (4.4), [Roehlsberger].

Parameters:
  • isotope (MoessbauerIsotope) – Resonant isotope.

  • detuning (list or ndarray) – Detuning values, in units of resonant isotope linewidth.

Returns:

List of complex 2x2 scattering matrices.

Return type:

list

ForwardTransmissionMatrix(isotope, detuning)

Forward transmission matrix T of the layer, Eq. (4.16), [Roehlsberger].

Parameters:
  • isotope (MoessbauerIsotope) – Resonant isotope.

  • detuning (list or ndarray) – Detuning values, in units of resonant isotope linewidth.

Returns:

List of complex 2x2 layer matrices.

Return type:

list

GrazingLayerMatrix(isotope, detuning, angle)

Layer matrix L in grazing incidence geometry, Eq. (4.23), [Roehlsberger].

Parameters:
  • isotope (MoessbauerIsotope) – Resonant isotope.

  • detuning (list or ndarray) – Detuning values, in units of resonant isotope linewidth.

  • angle (float) – Incidence angle (degree).

Returns:

List of complex 4x4 layer matrices.

Return type:

list

GrazingPropagationMatrix(isotope, detuning, angle)

Propagation matrix F in grazing incidence geometry, Eq. (4.24), [Roehlsberger].

Parameters:
  • isotope (MoessbauerIsotope) – Resonant isotope.

  • detuning (list or ndarray) – Detuning values, in units of resonant isotope linewidth.

  • angle (float) – Incidence angle (degree).

Returns:

List of complex 4x4 propagation matrices.

Return type:

list

GrazingScatteringMatrix(isotope, detuning, angle, calc_transitions)

Scattering matrix f in grazing incidence geometry, Eq. (4.25), [Roehlsberger].

Parameters:
  • isotope (MoessbauerIsotope) – Resonant isotope.

  • detuning (list or ndarray) – Detuning values, in units of resonant isotope linewidth.

  • angle (float) – Incidence angle (degree).

Returns:

List of complex 4x4 propagation matrices.

Return type:

list

KzSigma(energy, angle)

Calculates the product \(k_z \sigma\) which should be << 1 for a valid roughness W matrix calculation in grazing incidence geometry, see [Roehlsberger].

Parameters:
  • energy (float) – X-ray energy (eV).

  • angle (float) – Incidence angle (deg).

Returns:

\(k_z \sigma\).

Return type:

float

Examples

Various ways to define a Layer.

# with a predefined material

material_Pt = = nx.Material.Template(nx.lib.material.Pt)

layer_Pt = nx.Layer(id = "Pt layer",
                    material = material_Pt,
                    thickness = 20,
                    roughness = 0.2,
                    thickness_fwhm = 0
                    )

print(layer_Pt)
# material definition by the layer constructor

layer_Pt = nx.Layer(id = "Pt layer",
                    composition = [["Pt", 1]],
                    density = 21.45,
                    thickness = 20,
                    roughness = 0.2,
                    thickness_fwhm = 0
                    )

print(layer_Pt)