Distribution
- class nexus.Distribution(points=101, id='')
Abstract class for
Distributionacting onHyperfineparameters. Do not use this class directly. A Distribution must be derived from this class in Python the following way.# definition of the derived class class DistributionDefinedInPython(nx.Distribution): def __init__(self, points, ...): super().__init__(points, "user defined distribution") ... followed by your code if needed ... # implementation of the actual distribution function def DistributionFunction(self): # here goes your implementation ..... # set the deltax values to a reasonable range x = np.array(self.SetRange(...)) ... # calculate the weight weight = a function of x most probably # set the weight values self.SetWeight(weight)
A lot of distribution are predefined in the library
distribution.- Parameters:
points (int) – Number of distribution points.
id (string) – User identifier.
- points
Number of distribution points.
- Type:
int
- delta
The delta values of the distribution.
- Type:
list
- weight
Relative weight of the delta values.
- Type:
list
- id
User identifier.
- Type:
string
- fit_variables
List of
nx.Varobjects.- Type:
list
- DistributionFunction()
Call of the distribution function implementation from python.
- SetRange(range)
Set
deltavalues to a specific range around zero.- Parameters:
range (double) – The total distribution range.
- SetWeight(values)
Set
weight. The sum of the weight values is normalized to one.- Parameters:
values (list or ndarray) – List of weight values.
- property delta
std::vector<(double,std::allocator<(double)>)>
- Type:
delta
- property fit_variables
std::vector<(p.Var,std::allocator<(p.Var)>)>
- Type:
fit_variables
- property id
std::string
- Type:
id
- property points
unsigned int
- Type:
points
- property weight
std::vector<(double,std::allocator<(double)>)>
- Type:
weight
Examples can be found in the Tutorial section.