Sample
- nexus.Sample(layers, geometry='f', angle=0.0, length=10, roughness='a', effective_thickness=0.3, drive_detuning=[], function_time=None, divergence=0.0, id='')
Added in version 2.0.0.
A sample constructor that generates either a
ForwardSample
orGrazingSample
.
- class nexus.Sample_v1
Constructor for
Sample
in versions 1.X.X.Removed in version 2.0.0: Use the
ForwardSample
orGrazingSample
instead. A sample constructorSample
still exists that generates either of the two from.- Parameters:
layers (list) – List of Layer in order of beam propagation.
geometry (string) –
Scattering geometry of the sample.
f - forward scattering
r - reflection in grazing incidence scattering
t - transmission in grazing incidence scattering
angle (float or
Var
) – Angle of incidence for grazing geometry (degree).length (float) – length of the sample along beam direction. Only used for grazing geometry.
roughness (string) –
Roughness model in grazing geometry.
n - no roughness
a - analytical model
e - effective density model
effective_thickness (float) – Layer thickness in the effective density model (nm).
drive_detuning (list or ndarray) – Detuning values for a sample on a Moessbauer drive.
function_time (
FunctionTime
) – AFunctionTime
implementation of the user to describe sample motion. Must return the phase factor \(\phi(t) = k x(t)\), where \(k\) is the photon wave vector along beam direction and \(x(t)\) the sample motion along the beam propagation direction.divergence (float or
Var
) – Divergence of the incidence angle given as the FWHM of the divergence (deg).id (string) – User identifier.
- layers
List of Layer in order of beam propagation.
- Type:
list
- geometry
Scattering geometry of the sample.
f - forward scattering
r - reflection in grazing incidence scattering
t - transmission in grazing incidence scattering
- Type:
string
- length
length of the sample along beam direction. Only used for grazing geometry.
- Type:
float
- roughness
Roughness model in grazing geometry.
n - no roughness
a - analytical model
e - effective density model
- Type:
string
- effective_thickness
Layer thickness in the effective density model (nm).
- Type:
float
- drive_detuning
Detuning values for a sample on a Moessbauer drive.
- Type:
list or ndarray
- function_time
A
FunctionTime
implementation of the user to describe sample motion. Must return the phase factor \(\phi(t) = k x(t)\), where \(k\) is the photon wave vector along beam direction and \(x(t)\) the sample motion along the beam propagation direction.- Type:
- divergence
Divergence of the incidence angle given as the FWHM of the divergence (deg).
- Type:
float or
Var
- id
User identifier.
- Type:
string
- effective_coordinates
Layer coordinates in the effective density model.
- Type:
list
- effective_layers
List of
EffectiveLayer
objects.- Type:
list
- EffectiveLayerSystem(nuclear)
Create an effective density model from the sample. Electronic scattering factors and matrices are always calculated.
- Parameters:
eff_layer_thickness (float) – Layer thickness in the effective density model.
nuclear (bool) – Calculate the matrices for nuclear scattering in addition to the electronic ones.
- ElectronicAmplitude()
Calculates the relative electronic amplitude behind the sample. It is given by the product of the complex transmission or layer matrices of the sample layers. The geometry is determined from the
geometry
.- Parameters:
energy (float) – X-ray energy (eV)
- Returns:
Electronic amplitude.
- Return type:
complex
- ElectronicAmplitudeMatrix()
Calculates the relative electronic amplitude matrix behind the sample. It is given by the product of the complex transmission or layer matrices of the sample layers. The geometry is determined from the
geometry
.- Parameters:
energy (float) – X-ray energy (eV)
- Returns:
Electronic amplitude.
- Return type:
complex
- ElectronicFieldAmplitude(num_points=101, angle=0.0)
Calculates the electronic X-ray field amplitude in the sample.
- Parameters:
energy (float) – X-ray energy (eV).
num_points (int) – Number of points of the output.
angle (float) – Incidence angle in grazing incidence geometry.
- Returns:
Electronic field amplitude in the sample.
- Return type:
complex
- ElectronicFieldIntensity(num_points=101, angle=0.0)
Calculates the electronic X-ray field intensity in the sample.
- Parameters:
energy (float) – X-ray energy (eV).
num_points (int) – Number of points of the output.
- Returns:
Electronic field intensity.
- Return type:
float
- ElectronicForwardAmplitude()
Calculates the electronic amplitude behind the sample in forward geometry .
- Parameters:
energy (float) – X-ray energy (eV).
- Returns:
Forward amplitude.
- Return type:
complex
- ElectronicForwardTransmission()
Calculates the electronic transmission behind the sample in forward geometry .
- Parameters:
energy (float) – X-ray energy (eV).
- Returns:
Forward transmission.
- Return type:
float
- ElectronicGrazingReflectivity(angle, calc_roughness, eff_layer_thickness)
Calculates the reflectivity intensity of the sample in grazing incidence geometry.
- Parameters:
energy (float) – X-ray energy (eV).
angle (float) – Incidence-angle of the sample (degree).
calc_roughness (string) – Assumed roughness model, either n, a, e.
eff_layer_thickness (float) – Thickness of the layers in the effective layer model (e).
- Returns:
Reflectivity.
- Return type:
float
- ElectronicGrazingReflectivityAmplitude(angle, calc_roughness, eff_layer_thickness)
Calculates the complex reflectivity amplitude of the sample in grazing incidence geometry.
- Parameters:
energy (float) – X-ray energy (eV).
angle (float) – Incidence-angle of the sample (degree).
calc_roughness (string) – Assumed roughness model, either n, a, e.
eff_layer_thickness (float) – thickness of the layers in the effective layer model (e).
- Returns:
Complex reflectivity amplitude.
- Return type:
complex
- ElectronicGrazingSampleMatrix(angle, thickness, calc_roughness, eff_layer_thickness)
Calculates the electronic 2x2 sample matrix up to a certain sample thickness in grazing incidence geometry. It is the product of all layer matrices up to this thickness.
- Parameters:
energy (float) – X-ray energy (eV).
angle (float) – Incidence-angle of the sample (degree).
thickness (float) – Thickness at which the sample matrix should be calculated (nm).
calc_roughness (string) – Assumed roughness model, either n, a, e.
eff_layer_thickness (float) – thickness of the layers in the effective layer model (e).
- Returns:
Complex 2x2 matrix.
- Return type:
ndarray
- ElectronicGrazingTransmission(angle, calc_roughness, eff_layer_thickness)
Calculates the transmission intensity of the sample in grazing incidence geometry.
- Parameters:
energy (float) – X-ray energy (eV).
angle (float) – Incidence-angle of the sample (degree).
calc_roughness (string) – Assumed roughness model, either n, a, e.
eff_layer_thickness (float) – Thickness of the layers in the effective layer model (e).
- Returns:
Transmission.
- Return type:
float
- ElectronicGrazingTransmissionAmplitude(angle, calc_roughness, eff_layer_thickness)
Calculates the complex transmission amplitude of the sample in grazing incidence geometry.
- Parameters:
energy (float) – X-ray energy (eV).
angle (float) – Incidence-angle of the sample (degree).
calc_roughness (string) – Assumed roughness model, either n, a, e.
eff_layer_thickness (float) – thickness of the layers in the effective layer model (e).
- Returns:
Complex reflectivity amplitude.
- Return type:
complex
- ElectronicTransmission()
Calculates the relative electronic transmission behind the sample. It is given by the product of the complex transmission or layer matrices of the sample layers. The geometry is determined from the
geometry
.- Parameters:
energy (float) – X-ray energy (eV)
- Returns:
Electronic transmission.
- Return type:
float
- ForwardEffectiveThickness()
Returns the effective thickness \(t_{eff} = \sigma \sum_i \rho_{i} f^{LM}_i t_i\) of the sample in forward geometry, where \(\sigma\) is the nuclear cross section, \(\rho_{i}\) is the number density of the resonant nuclei in the i-th layer, \(f^{LM}_i\) is the Lamb Moessbauer factor of the i-th layer, \(t_i\) is the thickness of the layer i-th layer.
- Returns:
Effective thickness.
- Return type:
double
- Ids()
List with all layer id of the sample.
- Returns:
Layers ids.
- Return type:
list
- Interfaces()
A list with the positions of the layer interfaces.
- Returns:
Position of the Layer interfaces.
- Return type:
list
- KzSigma(angle_kz)
Calculates the product \(k_z \sigma\) for each layer in the sample. The product should be << 1 for the validity of the W matrix calculation.
- Parameters:
energy (float) – X-ray energy (eV).
angle (float) – Incidence angle (deg).
- Returns:
List of \(k_z \sigma\) values for each layer.
- Return type:
list
- LayerCenters()
A list with the center coordinates of all layers in the sample.
- Returns:
Position of the Layer centers.
- Return type:
list
- LayerPointer()
Returns a list of all layer pointers. Useful in order to check if layers have the same reference.
- Returns:
List of layer pointers
- Return type:
list
- PrintLayerPointers()
Print the pointer of each Layer. Useful in order to check if layers have the same reference.
- Returns:
Prints the layer pointers to the output
- SampleMatrix(detuning, angle=0.0, calc_roughness='a', eff_layer_thickness=0.1, calc_transitions=True)
Calculates the sample matrix - the product of all layer matrices in the given sample geometry. Same as the ObjectMatrix.
- Parameters:
isotope (
MoessbauerIsotope
) – Moessbauer isotope.detuning (list or ndarray) – Detuning values of the calculation.
angle (float) – Angle in grazing geometry (degree).
calc_roughness (string) –
Calculation mode for roughness.
n - no roughness a - analytical model e - effective density model
eff_layer_thickness (float) – Layer thickness for the effective density model (nm).
calc_transitions (bool) – Specifies if the nuclear transitions should be updated or not. Set this value to True.
- Returns:
List of complex 2x2 matrices.
- Return type:
list
- TotalThickness()
Calculates the total thickness of the sample.
- Returns:
Total thickness of the sample (nm).
- Return type:
float
- TotalThicknessEffective()
Total thickness of the sample in the effective density model.
- Returns:
Total thickness in the effective density model.
- Return type:
float