NRAO Home > CASA > CASA Toolkit Reference Manual
sd.fitter.set_function - Function

5.1.4 Set the function to be fitted
Description

Set the function to be fit.

The argument to be set determines what the fitter will do. If you want to do polynomial fitting, you have to set poly or lpoly arguments. The value of poly or lpoly are interpreted as an order of the polynomial function to be used for fitting. The poly is for non-linear least squares fitting, while lpoly is for linear one. If you want to do line fitting, you have to set either gauss or lorentz arguments. In that case, values of gauss or lorentz arguments are interpreted as a number of gaussian/lorentzian components. Apparently, gauss=0 or lorentz=0 causes an exception.

Note that all the above arguments are exclusive each other.

Arguments





Inputs

poly

Use a polynomial of the order given with nonlinear least squares fit

allowed:

integer

Default:

lpoly

Use a polynomial of the order given with linear least squares fit

allowed:

integer

Default:

gauss

Fit the number of gaussian specified

allowed:

integer

Default:

lorentz

Fit the number of lorentzian specified

allowed:

integer

Default:





Returns

Example

        f=sd.fitter()  
        # will fit a 3rd order polynomial via nonlinear method  
        f.set_function(poly=3)  
        # will fit a 3rd order polynomial via linear method  
        f.set_function(lpoly=3)  
        # will fit two gaussians  
        f.set_function(gauss=2)  
        # will fit two lorentzians  
        f.set_function(lorentz=2)


More information about CASA may be found at the CASA web page

Copyright 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search