dispersion_models

sans.models.dispersion_models

Class definitions for python dispersion model for model parameters. These classes are bridges to the C++ dispersion object.

The ArrayDispersion class takes in numpy arrays only.

Usage: These classes can be used to set the dispersion model of a SANS model parameter:

cyl = CylinderModel() cyl.set_dispersion(‘radius’, GaussianDispersion())

After the dispersion model is set, you can access it’s parameter through the dispersion dictionary:

cyl.dispersion[‘radius’][‘width’] = 5.0
TODO:For backward compatibility, the model parameters are still kept in a dictionary. The next iteration of refactoring work should involve moving away from value-based parameters to object-based parameter. We want to store parameters as objects so that we can unify the ‘params’ and ‘dispersion’ dictionaries into a single dictionary of parameter objects that hold the complete information about the parameter (units, limits, dispersion model, etc...).
class sans.models.dispersion_models.ArrayDispersion

Bases: sans.models.dispersion_models.DispersionModel

Python bridge class for a dispersion model based on arrays. The user has to set a weight distribution that will be used in the averaging the model parameter it is applied to.

set_weights(values, weights)

Set the weights of an array dispersion Only accept numpy arrays.

Parameters:
  • values – numpy array of values
  • weights – numpy array of weights for each value entry
class sans.models.dispersion_models.DispersionModel

Python bridge class for a basic dispersion model class with a constant parameter value distribution

set_weights(values, weights)

Set the weights of an array dispersion

class sans.models.dispersion_models.GaussianDispersion

Bases: sans.models.dispersion_models.DispersionModel

Python bridge class for a dispersion model based on a Gaussian distribution.

set_weights(values, weights)

Set the weights of an array dispersion

class sans.models.dispersion_models.LogNormalDispersion

Bases: sans.models.dispersion_models.DispersionModel

Python bridge class for a dispersion model based on a Log Normal distribution.

set_weights(values, weights)

Set the weights of an array dispersion

class sans.models.dispersion_models.RectangleDispersion

Bases: sans.models.dispersion_models.DispersionModel

Python bridge class for a dispersion model based on a Gaussian distribution.

set_weights(values, weights)

Set the weights of an array dispersion

class sans.models.dispersion_models.SchulzDispersion

Bases: sans.models.dispersion_models.DispersionModel

Python bridge class for a dispersion model based on a Schulz distribution.

set_weights(values, weights)

Set the weights of an array dispersion

Table Of Contents

Previous topic

DisperseModel

Next topic

DivComponent

This Page