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

1.1.1 Create a (sub)image from a region of the image
Description

This function copies all or part of the image to another on-the-fly Image tool.

If outfile is given, the subimage is written to the specified disk file. If outfile is unset, the returned Image tool actually references the input image file (i.e. that associated with the Image tool to which you are applying this function). So if you deleted the input image disk file, it would render this tool useless. When you destroy this tool (with the done function) the reference connection is broken.

Sometimes it is useful to drop axes of length one (degenerate axes). Use the dropdeg argument if you want to do this.

The output mask is the combination (logical OR) of the default input pixel mask (if any) and the OTF mask. Any other input pixel masks will not be copied. Use function maskhandler if you need to copy other masks too.

Arguments





Inputs

outfile

Output image file name. Default is unset.

allowed:

string

Default:

region

Region of interest. Default is whole image.

allowed:

any

Default:

record

mask

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

allowed:

any

Default:

variant

dropdeg

Drop degenerate axes

allowed:

bool

Default:

false

overwrite

Overwrite (unprompted) pre-existing output file?

allowed:

bool

Default:

false

list

List informative messages to the logger

allowed:

bool

Default:

true

Returns
casaimage

Example

"""  
#  
print "\t----\t subimage Ex 1 \t----"  
ia.maketestimage(’myfile’,overwrite=true)  
im2 = ia.subimage()                # a complete copy  
r1 = rg.box([10,10],[30,40],[5,5]) # A strided pixel box region  
im3 = ia.subimage(outfile=’/tmp/foo’, region=r1, overwrite=true)  
                                   # Explicitly named subimage  
im2.done()  
im3.done()  
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.