Produced by IDL 7.1.1
User Documentation

./guide
getbasemodel.pro

Last modification date:
Wed Sep 28 13:27:08 2016

getbasemodel

function getbasemodel([nfit=integer], [ok=variable])

Function to return the polynomial using the most recently fitted baseline coefficients and !g.nfit or the nfit keyword using the data in the primary data container. This function is used in all of the GUIDE baseline related functions but may also be useful in other uses.

Note that getbasemodel does not do any fitting. Use baseline or bshape to generate a new fit.

Since orthogonal polynomials are used internally, using up to any nfit less than or equal to the value of nfit used when the polynomials were generated is itself the fit that would have resulted had that smaller nfit been used in the first place. In this way, getbasemodel can be used to generate the model fit for any value of nfit up to the nfit actually used to generate the most recently fit polynomial.

Returns
Array corresponding to the polynomial at !g,polyfit through nfit evaluated at all of the channels in the primary data container. Returns -1 on failure (ok will be 0).
Examples
    getrec, 20                            ; get some data
    nregion,[100,500,700,1000,1600,2000]  ; set up regions to fit
    nfit,7                                ; 7th order fit
    bmodel                                ; do the fit
    lastfit = getbasemodel()              ; get the fit
    lastfit_n2 = getbasemodel(nfit=2)     ; only use up to 2nd order terms
 
Uses
ortho_poly data_valid
Version
$Id$

Keywords
nfit
in, optional
integer
Only use at most nfit parameters. If !g.nfit is less then nfit, then only !g.nfit parameters will be used and a warning will be issued.
ok
out, optional
variable
1 on success, 0 on failure.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:34 2016