nraonrao
 
 NRAO Home > CASA > CasaDocument
image.fitprofile - Function

1.1.1 Fit 1-dimensional profile with functional forms
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. Look at the example for information on accessing returned 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.

Arguments





Outputs

values

Output fitted or estimated profile

allowed:

doubleArray

Default:

resid

Output residual profile

allowed:

doubleArray

Default:

Inputs

region

The region of interest. Default is whole image.

allowed:

any

Default:

record

axis

The profile axis. Default is spectral axis.

allowed:

int

Default:

-1

mask

OTF mask, Boolean LEL expression or mask region. Default is none.

allowed:

any

Default:

variant

estimate

Initial estimate. Default is unset.

allowed:

any

Default:

record

ngauss

Number of Gaussian elements. Default is one.

allowed:

int

Default:

-1

poly

Order of polynomial element. Default is unset.

allowed:

int

Default:

-1

fit

Do fit or get estimate

allowed:

bool

Default:

true

sigma

Weights image. Default is unset.

allowed:

string

Default:

Returns
anyrecord

Example

"""  
#  
print "\t----\t fitprofile Ex 1 \t----"  
ia.maketestimage(’gc.small’, overwrite=true)  
fit = ia.fitprofile(axis=1, fit=T)     # Auto-est and fit  
print fit.keys()  
#print fit[’return’]  
#print fit[’values’]  
#print fit[’resid’]  
 
ia.close()  
#  
"""

Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu

Copyright © 2007 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

Updated daily during alpha development.