TwoPowerLawModel

sans.models.TwoPowerLawModel

Provide I(q) = A*pow(qval,-1.0*m1) for q<=qc
=scale*pow(qval,-1.0*m2) for q>qc

TwoPowerLaw function as a BaseComponent model

class sans.models.TwoPowerLawModel.TwoPowerLawModel

Bases: sans.models.BaseComponent.BaseComponent

Class that evaluates a TwoPowerLawModel.

I(q) = coef_A*pow(qval,-1.0*power1) for q<=qc
=C*pow(qval,-1.0*power2) for q>qc

where C=coef_A*pow(qc,-1.0*power1)/pow(qc,-1.0*power2). List of default parameters:

coef_A = coefficient power1 = (-) Power @ low Q power2 = (-) Power @ high Q qc = crossover Q-value background = incoherent background
calculate_ER()
clone()

Returns a new object identical to the current object

evalDistribution(qdist)

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(name)

Set the value of a model parameter

Parameters:name – name of the parameter
getParamList()

Return a list of all available parameters for the model

getParamListWithToken(token, member)
getParamWithToken(name, token, member)
is_fittable(par_name)

Check if a given parameter is fittable or not

Parameters:par_name – the parameter name to check
run(x=0.0)

Evaluate the model @param x: input q-value (float or [float, float] as [r, theta]) @return: (guinier value)

runXY(x=0.0)

Evaluate the model @param x: input q-value (float or [float, float] as [qx, qy]) @return: guinier value

setParam(name, value)

Set the value of a model parameter

Parameters:
  • name – name of the parameter
  • value – value of the parameter
setParamWithToken(name, value, token, member)

Table Of Contents

Previous topic

TwoLorentzianModel

Next topic

UnifiedPowerRgModel

This Page