DisperseModel

sans.models.DisperseModel

Wrapper for the Disperser class extension

author:Mathieu Doucet / UTK
contact:mathieu.doucet@nist.gov
class sans.models.DisperseModel.DisperseModel

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])
__add__()
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x0200CEB0>
__div__()
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()

Initialization

Parameters:
  • model – Model to disperse [BaseComponent]
  • paramList – list of parameters to disperse [List of strings]
  • sigmaList – list of std deviations for Gaussian dispersion [List of floats]
__module__ = 'sans.models.DisperseModel'
__mul__()
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__sub__()
__weakref__

list of weak references to the object (if defined)

_clone()

Internal utility function to copy the internal data members to a fresh copy.

calculate_ER()
clone()

Return a identical copy of self

evalDistribution()

Evaluate a distribution of q-values.

  • For 1D, a numpy array is expected as input:

    evalDistribution(q)

where q is a numpy array.

  • For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], where 1D arrays,

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

their own evalDistribution methods.

The method is then called the following way:

evalDistribution(q) where q is a numpy array.

Parameters:qdist – ndarray of scalar q-values or list [qx,qy] where qx,qy are 1D ndarrays
getDispParamList()

Return a list of all available parameters for the model

getParam()
getParamList()

Return a list of all available parameters for the model

getParamListWithToken()
getParamWithToken()
is_fittable()

Check if a given parameter is fittable or not

Parameters:par_name – the parameter name to check
model

Model to disperse

params

Parameters

run()

Evaluate the model

Parameters:x – input q, or [q,phi]
Returns:scattering function P(q)
runXY()

Evaluate the model

Parameters:x – input q, or [q,phi]
Returns:scattering function P(q)
setParam()
setParamWithToken()

Table Of Contents

Previous topic

DiamEllipFunc

Next topic

dispersion_models

This Page