Layer

[1]:
import nexus as nx
import numpy as np

mat = nx.Material.Template(nx.lib.material.Fe2O3)

layer = nx.Layer(id = "iron oxide layer",
                 thickness = 1000,  # in nanometer
                 material = mat,
                 # roughness = 30,
                 # thickness_fwhm = 50
                 )

print(layer)
Layer
  .id: iron oxide layer
  .material.id: Fe2O3 hematite
  .material.composition:  Fe 2.0, O 3.0,
  .material.density (g/cm^3) Var.value = 5.25, .min = 0.0, .max = 5.25, .fit: False, .id:
  .thickness (nm) Var.value = 1000.0, .min = 0.0, .max = inf, .fit: False, .id:
  .roughness (nm, sigma) Var.value = 0.0, .min = 0.0, .max = inf, .fit: False, .id:
  .thickness_fwhm (nm) Var.value = 0.0, .min = 0.0, .max = inf, .fit: False, .id:

[2]:
layer = nx.Layer(id = "iron oxide layer",
                 thickness = 1000,  # in nanometer
                 # roughness = 30,
                 # thickness_fwhm = 50
                 composition = [["Fe", 2], ["O", 3]],
                 density = 5.3
                 )

layer.material.density = 6.1

print(layer)

layer.density = 4.9

print(layer)
Layer
  .id: iron oxide layer
  .material.id:
  .material.composition:  Fe 2.0, O 3.0,
  .material.density (g/cm^3) Var.value = 6.1, .min = 0.0, .max = 23.0, .fit: False, .id:
  .thickness (nm) Var.value = 1000.0, .min = 0.0, .max = inf, .fit: False, .id:
  .roughness (nm, sigma) Var.value = 0.0, .min = 0.0, .max = inf, .fit: False, .id:
  .thickness_fwhm (nm) Var.value = 0.0, .min = 0.0, .max = inf, .fit: False, .id:

Layer
  .id: iron oxide layer
  .material.id:
  .material.composition:  Fe 2.0, O 3.0,
  .material.density (g/cm^3) Var.value = 4.9, .min = 0.0, .max = 23.0, .fit: False, .id:
  .thickness (nm) Var.value = 1000.0, .min = 0.0, .max = inf, .fit: False, .id:
  .roughness (nm, sigma) Var.value = 0.0, .min = 0.0, .max = inf, .fit: False, .id:
  .thickness_fwhm (nm) Var.value = 0.0, .min = 0.0, .max = inf, .fit: False, .id:

[3]:
# refractive index of a layer
ref_index = layer.ElectronicRefractiveIndex(energy = 14412.5)

print(ref_index)
(0.9999952911043145+1.4925088081386838e-07j)
[4]:
#critical angle at 16 keV
ang = layer.CriticalAngle(energy=16e3)

print(ang * 180/np.pi)
0.1583868640530339