ConussObject

class nexus.ConussObject(file_name='', angle=0.0, divergence=0.0, id='')

Bases: NxObject

Constructor for a ConussObject. A ConussObject is an object in the beam path with the scattering matrix calculated from CONUSS module kref. This is implemented as diffraction is not included in Nexus so far. Especially useful for Sychrotron Moessbauer Source experiments to obtain the correct output field of the source.

Added in version 1.0.1.

Parameters:
  • file_name (string) – file to be loaded. This is generated by the kref module of CONUSS.

  • angle (Var) – incidence angle of the radiation (rad) as defined in CONUSS.

  • divergence (Var) – FWHM of divergence of the incidence radiation (rad) as defined in CONUSS.

  • id (string) – User identifier.

file_name

file to be loaded. This is generated by the kref module of CONUSS.

Type:

string

angle

incidence angle of the radiation (rad). The angle should be the input/output by the kfit module of CONUSS.

Type:

Var

divergence

FWHM of divergence of the incidence radiation (rad). The angle should be the input/output by the kfit module of CONUSS.

Type:

Var

angles

array of the angles for which the scattering matrix is calculated in the loaded CONUSS file.

Type:

array

detuning

array of detuning values.

Type:

array

scattering_factor

Electronic scattering factor at the central angle of angles after initialization or the user set index of the angles array.

Type:

complex

object_matrix

Fixed (detuning-independent) 2x2 complex object matrix at the central angle of angles after initialization or the user set index of the angles array. Corresponds to a layer/sample/object matrix type.

Type:

array

id

User identifier.

Type:

string

ElectronicAmplitude(energy)

Returns the relative electronic amplitude behind the object. Corresponds to the electronic scattering factor.

Parameters:

energy (float) – no dependence

Returns:

electronic scattering factor set during initialization

Return type:

complex

ElectronicAmplitudeMatrix(energy)

Electronic scattering matrix of the object.

Parameters:

energy (float) – Not used.

Returns:

2x2 scattering matrix.

Return type:

list

GetDetuning()

Returns the detuning grid used in CONUSS.

Returns:

array of detuning values.

Return type:

ndarray

ObjectInfo()

Prints additional object information.

ObjectMatrix(detuning=[])

Returns the detuning-dependent object matrix. Corresponds to a layer matrix type.

Parameters:

detuning (ndarray or list) – n-dimensional array with detuning values.

Returns:

n-dimensional array of 2x2 complex arrays.

Return type:

array

ObjectMatrixAtIndex(index, detuning=[])

Returns the detuning-dependent object matrix. Corresponds to a layer matrix type.

Parameters:
  • index (int) – index of the array.

  • detuning (ndarray or list) – n-dimensional array with detuning values.

Returns:

n-dimensional array of 2x2 complex arrays.

Return type:

array

ScatteringFactorAtIndex(index)

Returns the scattering factor corresponding to the angles array.

Parameters:

index (int) – Index of the scattering factor corresponding to the angles array.

Returns:

scattering factor.

Return type:

Complex

SetPropertiesAtIndex(index)

Set the scattering_factor and the object_matrix to the ones at the given index. The index corresponds to the index of the angles array. The set objects are used in the functions ElectronicAmplitude() and ElectronicAmplitudeMatrix(). These functions are also used by Nexus in for calculations of electronic properties and amplitude calculations.

Parameters:

index (int) – Used index of the scattering matrices array.

Examples

Define a ConussObject.

file = "name.bin"

conuss_object = nx.ConussObject(file_name = file, module = "kfor", "my conuss object")

print(conuss_object)

print(conuss_object.GetDetuning())

print(conuss_object.ObjectMatrix())