Produced by IDL 6.1
User Documentation

./guide
File bshape.pro

Last modification date:
Tue Dec 7 22:50:36 2004


bshape

procedure bshape, [nfit=integer], [/noshow], [/nofit], [index=integer], [modelindex=integer], [status=integer]

Fit a baseline to !g.s[0] and overplot that fit on top of the current plot.

This fits a set of orthogonal polynomials with a maximum order given by the !g.nfit value to the data values in the [index] data container. The range of channels to use is given by !g.regions and !g.nregion. The parameters of the fit are placed in to !g.polyfit and the polynomial is evaluated over all channels and that result is placed into the container at modelindex (see the comments for that keyword for more details), which is otherwise a copy of the data at index.

Much of this behavior can be changed by use of the keywords. Read the descriptions for each keyword to see what options are available.

Examples
 ; fit, using the value of !g.nfit
 !g.nfit=3
 bshape
 ; You've done several bshapes and want to see just the most recent
 show
 bshape,/nofit
 
Uses
get_chans dcbaseline ortho_poly data_valid copy
Version
$Id: bshape.pro,v 1.1 2004/12/08 03:50:36 bgarwood Exp $

Keywords
nfit
in, optional
integer
The order of polynomial to fit. Defaults to !g.nfit. If set, then this also sets the value of !g.nfit.
noshow
in, optional
boolean
If set, the result is not shown (overplotted). If the plotter is frozen, then nothing is overplotted even if this keyword is not set.
nofit
in, optional
boolean
If set, no fit is made, instead, the contents of the data container at [modelindex] or !g.polyfit are used to overplot the baseline. See the comments for the modelindex as they inpact how this keyword behaves.
index
in, optional
integer
The index of the global data container to use. Defaults to 0.
modelindex
in, optional
integer
The index number to hold the fit evaluated at all channels (the model). If not set, this defaults to -1. If set to -1, then no index will hold the model after this procedure is used. If nofit is set and modelindex is -1, then the model used is generated from the parameters, otherwise the modelindex is used (and there is no way to check that modelindex is a valid baseline model).
status
in, optional
integer
This is set to 1 on success and 0 on failure. This is primarily so that baseline can use bshape and know whether it succeeded or not without having to turn bshape in to a function.


Produced by IDLdoc 1.5 on Wed Dec 8 13:08:14 2004