class PseudoVoigtModel( NonLinearModel ) | Source |
---|
Approximation of VoigtModel as the sum of a GaussModel and a LorentzModel
F(x:p) = p3 * L(x:p) + ( 1 - p3 ) * G(x:p)
where L() and G() are the LorentzModel and the GaussModel, resp. and p3 is the fractional contribution of them. 0 < p3 < 1.
The models takes 4 parameters: amplitude, center frequency, half-width and the balance between the models
These are initialised to [1, 0, 1, 0.5]. Parameter 2 (width) is always kept positive ( >=0 ).
Examples
voigt = PseudoVoigtModel( )
voigt.setParameters( [5, 4, 1, 0.7] )
print( voigt( numpy.arange( 41 , dtype=float ) / 5 ) ) # from [0,8]
Attributes
- gauss : GaussModel
to construct the gauss parts - lorentz : LorentzModel
to construct the lorentz parts
Attributes from Model
npchain, parameters, stdevs, xUnit, yUnit
Attributes from FixedModel
npmax, fixed, parlist, mlist
Attributes from BaseModel
npbase, ndim, priors, posIndex, nonZero, tiny, deltaP, parNames
PseudoVoigtModel( copy=None, **kwargs ) |
---|
PseudoVoigt model.
Number of parameters is 4.
Parameters
- copy : PseudoVoigtModel
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
copy( ) |
---|
baseResult( xdata, params ) |
---|
Note
- The "balance" parameter (item 3) should be kept between [0..1]
- The "width" parameter (item 2) the width in the parameter array ( items 2 & 3 ) are kept strictly positive. I.e. they are changed when upon xdata they are negative.
Parameters
- xdata : array_like
values at which to calculate the result - params : array_like
values for the parameters.
basePartial( xdata, params, parlist=None ) |
---|
Parameters
- xdata : array_like
values at which to calculate the partials - params : array_like
values for the parameters. - parlist : array_like
list of indices active parameters (or None for all)
baseDerivative( xdata, params ) |
---|
Parameters
- xdata : array_like
values at which to calculate the derivative - params : array_like
values for the parameters.
baseName( ) |
---|
baseParameterUnit( k ) |
---|
Parameters
- k : int
parameter number.
Methods inherited from NonLinearModel |
---|
Methods inherited from Model |
---|
- chainLength( )
- isNullModel( )
- isolateModel( k )
- addModel( model )
- subtractModel( model )
- multiplyModel( model )
- divideModel( model )
- pipeModel( model )
- appendModel( model, operation )
- correctParameters( params )
- result( xdata, param=None )
- operate( res, pars, next )
- derivative( xdata, param, useNum=False )
- selectPipe( ndim, ninter, ndout )
- pipe_0( dGd, dHdG )
- pipe_1( dGd, dHdG )
- pipe_2( dGd, dHdG )
- pipe_3( dGd, dHdG )
- pipe_4( dGdx, dHdG )
- pipe_5( dGdx, dHdG )
- pipe_6( dGdx, dHdG )
- pipe_7( dGdx, dHdG )
- pipe_8( dGdx, dHdG )
- pipe_9( dGdx, dHdG )
- shortName( )
- getNumberOfParameters( )
- numDerivative( xdata, param )
- numPartial( xdata, param )
- isDynamic( )
- hasPriors( isBound=True )
- getPrior( kpar )
- setPrior( kpar, prior=None, **kwargs )
- getParameterName( kpar )
- getParameterUnit( kpar )
- getIntegralUnit( )
- setLimits( lowLimits=None, highLimits=None )
- getLimits( )
- hasLimits( fitindex=None )
- unit2Domain( uvalue, kpar=None )
- domain2Unit( dvalue, kpar=None )
- partialDomain2Unit( dvalue )
- nextPrior( )
- getLinearIndex( )
- testPartial( xdata, params, silent=True )
- strictNumericPartial( xdata, params, parlist=None )
- assignDF1( partial, i, dpi )
- assignDF2( partial, i, dpi )
- strictNumericDerivative( xdata, param )
Methods inherited from FixedModel |
---|
Methods inherited from BaseModel |
---|