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

1.1.1 Fit 2-dimensional models to the sky
Description

This function fits 2-dimensional models to regions of the sky. You can fit multiple models simulataneously, although only Gaussian models are currently implemented. The fit is returned as a record that can be loaded into a Componentlist tool with the fromrecord() function.

Return value is a record with 4 elements. The keys are ’return’, ’pixelmask’, ’pixels’ and ’converged’.

Arguments





Inputs

region

The 2-D region of interest to fit. Default is whole image.

allowed:

any

Default:

record

mask

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

allowed:

any

Default:

variant

models

The model types to fit simultaneously. Default is [’gaussian’]

allowed:

stringArray

Default:

gaussian

estimate

Initial estimate for the model (from componentlist.torecord()). Default is to use an internal estimate.

allowed:

any

Default:

record

fixedparams

Parameters to hold fixed per model, String or vector of strings, one per model. Choose from “fxyabp”. Default is all parameters vary.

allowed:

stringArray

Default:

includepix

Range of pixel values to include. For default behaviour see discussion.

allowed:

doubleArray

Default:

-1

excludepix

Range of pixel values to exclude. For default behaviour see discussion.

allowed:

doubleArray

Default:

-1

fit

Do fit or get estimate

allowed:

bool

Default:

true

deconvolve

Deconvolve from restoring beam

allowed:

bool

Default:

false

list

List informative messages to the logger

allowed:

bool

Default:

true

Returns
anyrecord

Example

"""  
#  
print "\t----\t fitsky Ex 1 \t----"  
ia.maketestimage(’image.large’, overwrite=true)  
innerquarter=ia.setboxregion([0.25,0.25],[0.75,0.75],frac=true)  
ia.fromimage(outfile=’image.small’, infile=’image.large’,  
             region=innerquarter, overwrite=true)  
ia.close()  
ia.open(’image.small’)  
cl1 = ia.fitsky(models=["gaussian"])  
print cl1.keys()  
# ’pixels’,’pixelmask’,’converged’,’return’  
print cl1[’return’] # ’return’ field holds a componentlist record  
if cl1[’converged’]:  
  ia.close()  
  ia.open(’image.large’)  
  cl2 = ia.fitsky(models=["gaussian"], estimate=cl1[’return’])  
  print cl2[’return’]  
ia.close()  
#  
"""

In this example we assume the image is 2-dimensional. We fit the first image using the internal starting estimate for the model parameters. We fit the second image using the result of the first fit as the starting estimate.

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.