ConussObject

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

Bases: NxObject

Proxy of C++ ConussObject class.

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

GetAddress(NxObject self) → std::string
GetDetuning()

Returns the detuning grid used in CONUSS.

Returns:

array of detuning values.

Return type:

ndarray

GetDivergenceDistributionSize(ConussObject self) → size_t
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

PopulateDivergence(ConussObject self)
PopulateFitHandler(ConussObject self, OptimizerHandler fit_handler)
ResetDivergence(ConussObject self)
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.

Update(ConussObject self)
property angle

p.Var

Type:

angle

property angles

std::vector<(double,std::allocator<(double)>)>

Type:

angles

property detuning

std::vector<(double,std::allocator<(double)>)>

Type:

detuning

property divergence

p.Var

Type:

divergence

property divergence_distribution_weight

std::vector<(double,std::allocator<(double)>)>

Type:

divergence_distribution_weight

property divergence_index

size_t

Type:

divergence_index

property file_name

std::string

Type:

file_name

property id

std::string

Type:

id

property object_id

NxObjectId

Type:

object_id

property object_matrices

std::vector<(ObjectMatrix2,std::allocator<(ObjectMatrix2)>)>

Type:

object_matrices

property object_matrix

ObjectMatrix2

Type:

object_matrix

property scattering_factor

Complex

Type:

scattering_factor

property scattering_factors

std::vector<(Complex,std::allocator<(Complex)>)>

Type:

scattering_factors

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())