Wrapper for the Disperser class extension
author: | Mathieu Doucet / UTK |
---|---|
contact: | mathieu.doucet@nist.gov |
Bases: Disperser, sans.models.BaseComponent.BaseComponent
Wrapper class for the Disperser extension Python class that takes a model and averages its output for a distribution of its parameters.
The parameters to be varied are specified at instantiation time. The distributions are Gaussian, with std deviations specified for each parameter at instantiation time.
Example:
cyl = ModelFactory().getModel("CylinderModel")
disp = DisperseModel(cyl, ['cyl_phi'], [0.3])
disp.run([0.01, 1.57])
Evaluate a distribution of q-values.
For 1D, a numpy array is expected as input:
evalDistribution(q)
where q is a numpy array.
qx_prime = [ qx[0], qx[1], qx[2], ....] and qy_prime = [ qy[0], qy[1], qy[2], ....]
Then get q = numpy.sqrt(qx_prime^2+qy_prime^2)
that is a qr in 1D array; q = [q[0], q[1], q[2], ....]
Note : | Due to 2D speed issue, no anisotropic scattering is supported for python models, thus C-models should have
|
---|
The method is then called the following way:
evalDistribution(q) where q is a numpy array.
Parameters: |
|
---|
Check if a given parameter is fittable or not
Parameters: |
|
---|
Evaluate the model
Parameters: |
|
---|---|
Returns: | scattering function P(q) |
Evaluate the model
Parameters: |
|
---|---|
Returns: | scattering function P(q) |