Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: image.fitpolynomial - Function Up: image - Tool Previous: image.fitallprofiles - Function


image.fitprofile - Function



Package general
Module images
Tool image


Fit 1-dimensional profile with functional forms


Synopsis
fitprofile(values, resid, region, axis, mask, estimate, ngauss, poly, fit, sigma)


Arguments

values out Output fitted or estimated profile
    Allowed: Numeric Glish array
    Default: None
resid out Output residual profile
    Allowed: Numeric Glish array
region in The region of interest
    Allowed: Region tool
    Default: Whole image
axis in The profile axis
    Allowed: Integer or unset
    Default: Spectral
mask in OTF mask
    Allowed: Boolean LEL expression or mask region
    Default: None
estimate in Initial estimate
    Allowed: Record
    Default: Unset
ngauss in Number of Gaussian elements
    Allowed: Int
    Default: 1
poly in Order of polynomial element
    Allowed: Int
    Default: Unset
fit in Do fit or get estimate
    Allowed: T or F
    Default: T
sigma in Weights image
    Allowed: String or unset
    Default: unset


Returns
Record or fail



Description
This function fits 1-dimensional models to profiles. All data in the specified region (except along the fitting axis) are averaged.

The behaviour is primarily controlled by argument fit.

If fit==T then you need an estimate. If estimate is unset, then that estimate is automatically provided by fitting ngauss gaussians. If estimate is set then it is used to provide the initial estimate.

The functional form that is actually fit for will be any polynomial specified by the poly argument, plus the number of gaussians present in the estimate.

If fit==F then an estimate is created and returned. If estimate is empty, than an estimate for ngauss gaussians is made. If estimate is not empty, then it is just evaluated.

After calling this function, argument values holds the fitted or estimated profile values, and argument resid holds the fitted or estimated residual profile values.

The output mask is a copy of the default input pixel mask (if any); the OTF mask does not contribute. Any other input pixel masks will not be copied. Use function maskhandler if you need to copy other masks too. Use function calcmask if you need to apply the OTF mask to the output.



Example
- myim := image('gc.small')
- local values, resid
- fit := myim.fitprofile(values, resid, axis=3, fit=T)     # Auto-est and fit





next up previous contents index
Next: image.fitpolynomial - Function Up: image - Tool Previous: image.fitallprofiles - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01