Menu

PartialFit

A. Smith

PartialFit

The PartialFit function allows the user to select only part of a spectrum and fit that region. One must specify the region to be fitted, and optionally may select which peaks in that region should be fit. The advantage of using this function as opposed to simply clipping the spectrum (see ‘clip_spec_nD’) and fitting, is that PartialFit takes into account peaks neighboring the region to be fitted either by referencing to an initial fit or by performing an approximate peak pick and linewidth estimation of surrounding peaks before fitting. Note that the PartialFit function is a critical component to the FitEditor2D and the FitError functions. PartialFit is called as follows:

fit = PartialFit(spec,par,fit0)

where the ‘par’ and ‘fit0’ variables are optional. A fourth argument, ‘shapes0’, can be also provided. The ‘spec’ and ‘fit0’ are the same as described for FitSpec. ‘par’ has the same fields as described for FitSpec, plus two additional fields.

par.fit_range: This is given in a vector with entries [LB1 UB1 LB2 UB2 …] where LB and UB indicate the lower and upper bounds of each dimension. Therefore, this must have a size of 2 X # of dimensions.

par.index: This is an optional field, only available if an initial fit is given. This allows the user to choose which peaks should be fitted. Therefore, this is either a logical index with an entry for each peak (must be same size as ‘fit0.I’, ‘fit0.delta1’, etc.), or a list of numbers for all the peaks that should be fitted (to fit peaks 1,3,10, then fit0.index=[1 3 10])


Auth0 Logo