Residual

class nexus.Residual(*args)

Abstract class for Residual. Do not use this class directly. A Residual implementation must be derived from this class in Python the following way.

# definition of the derived class
class ResidualDefinedInPython(nx.Residual):
    def __init__(self, id = "my residual implementation"):
        super().__init__(id)

    # implementation of the actual residual function
    def ResidualFunction(self, input_data, input_theory):
        residual = ...
        return residual

Some residual weight functions are predefined in the library residual.

Parameters:
  • id (string) – User identifier.

  • plot_string (string) –

    String used for .plot() functions in residual plot.

    New in version 1.0.3.

id

User identifier.

Type:

string

plot_string

String used for .plot() functions in residual plot.

New in version 1.0.3.

Type:

string

ResidualFunction(intensity_data, intensity_theory)

Call of the residual function implementation from python.

Returns:

List of residual values of measured and theoretical intensities.

Return type:

list or ndarray

Examples can be found in the Tutorial section.