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"): # since version 2.0.0 it must be # def __init__(self, id = "my residual implementation", exponent=X): super().__init__(id, exponent) # implementation of the actual residual function def ResidualFunction(self, input_data, input_theory): residual = ... return residual def __init__(self, id = "my residual implementation"):
Changed in version 2.0.0: Exponent must be specified since version 2.0.0
Some residual weight functions are predefined in the library
residual
.- Parameters:
id (string) – User identifier.
exponent (double) –
Exponent of the residual function. For least square problems it is 2.
Added in version 2.0.0.
plot_string (string) –
String used for .plot() functions in residual plot.
Added in version 1.0.3.
- id
User identifier.
- Type:
string
- exponent
Exponent of the residual function. For least square problems it is 2.
Added in version 2.0.0.
- Type:
double
- plot_string
String used for .plot() functions in residual plot.
Added 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.