Kernel2dModel

 
Kernel2dModel = class Kernel2dModel(NonLinearModel)
    Kernel2dModel(kernel=<Gauss object at 0x11caf0130>, shape=1, copy=None, **kwargs)
 
Two dimensional Kernel Model.
 
The Kernel2dModel is defined as
 
    f( x:p ) = p_0 * K( r )
 
where K( r ) is a selectable kernel function and r is the distance to the center.
 
    r = sqrt( u^2 + v^2 ).
 
There are 3 options for u and v
 
1. CIRCULAR has 4 parameters
    Circular shape with only one width.
    u = ( x - p_1 ) / p_3
    v = ( x - p_2 ) / p_3
2. ELLIPTIC has 5 parameters
    Elliptic shape aligned along the axes; 2 widths.
    u = ( x - p_1 ) / p_3
    v = ( x - p_2 ) / p_4
3. ROTATED has 6 parameters
    Rotated elliptical shape with 2 width and a rotational angle.
    u = ( ( x - p_1 )*cos( p_5 ) - ( y - p_2 )*sin( p_5) ) / p_3
    v = ( ( x - p_1 )*sin( p_5 ) + ( y - p_2 )*cos( p_5) ) / p_4
 
The "center" parameters ( 1&2 ) and the "angle" parameter ( 5 ) are initilized as 0.
The rotational angle is measured counterclockwise from the x-axis.
The "width" parameters ( 3&4 ) are initialized as 1.0, except for the ROTATED case;
then they need to be different ( 2.0 and 0.5 resp. ).
Otherwise the model parameter "angle" is degenerate.
The "amplitude" parameter is set to 1.0.
 
Several kernel functions, K( x ) are defined in the directory fit/kernels.
 
Beware: These models are unaware of anything outside their range.
 
Author:      Do Kester
 
Example
-------
>>> model = Kernel2dModel( )                                 # default: circular Gauss
>>> model.setKernelShape( Lorentz(), 'Elliptic'  )             # elliptic Lorentz model.
>>> model = Kernel2dModel( shape=3 )                         # rotated Gauss
 
Category:    mathematics/Fitting
 
 
Method resolution order:
Kernel2dModel
NonLinearModel
Model
FixedModel
BaseModel
builtins.object

Constructor:
Kernel2dModel( kernel=<Gauss object at 0x11caf0130>, shape=1, copy=None, **kwargs )
Kernel Model.
 
Default model: Gauss with Circular shape.
 
Parameters
----------
kernel : Kernel
    the kernel to be used
shape : 1 | 2 | 3 | 'circular' | 'elliptic' | 'rotated'
    int : resp.: circular elliptic, rotated
    str : case insensitive; only the first letter matters.
    shape defaults to 'circular' when misunderstood
copy : Kernel2dModel
    to be copied
fixed : None or dictionary of {int:float|Model}
    int         index of parameter to fix permanently.
    float|Model values for the fixed parameters.
    Attribute fixed can only be set in the constructor.
    See: FixedModel
Methods defined here:
baseDerivative( xdata, params )
Returns df/dx of the model function.
 
Parameters
----------
xdata : array_like
    value at which to calculate the result
params : array_like
    values for the parameters
baseName()
Returns a string representation of the model.
baseParameterUnit( k )
Return the unit of a parameter.
Parameters
----------
k : int
    the kth parameter.
basePartial( xdata, params, parlist=None )
Returns the partials at the xdata value.
 
Parameters
----------
xdata : array_like
    value at which to calculate the partials
params : array_like
    parameters to the model (ignored in LinearModels)
parlist : array_like
    list of indices of active parameters
baseResult( xdata, params )
Returns the result of the model function.
 
Parameters
----------
xdata : array_like
    value at which to calculate the result
params : array_like
    values for the parameters
copy()
Copy method.
isBound()
parseShape( shape )
setKernelShape( kernel, shape )

Methods inherited from NonLinearModel:
Methods inherited from Model:
Methods inherited from FixedModel:
Methods inherited from BaseModel: