NRAO Home > CASA > CASA Toolkit Reference Manual
image.newimagefromimage - Function

1.1.1 Construct an on-the-fly image tool from a region of a CASA image file


Description

This function applies a region-of-interest to a disk image file, creates a new image file containing the (sub)image, and associates a new image tool with it.

The input disk image file may be in native CASA, FITS(Float, Double, Short, Long are supported), or Miriad format. Look ?? for more information on foreign images.

If outfile is given, the (sub)image is written to the specified disk file.

If outfile is unset, the Image tool actually references the input image file. So if you deleted the input image disk file, it would render this tool useless. When you destroy this on-the-fly 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.

See also the subimage function.

Arguments





Inputs

infile

Input image file name. Required.

allowed:

string

Default:

outfile

Output sub-image file name. Default is unset.

allowed:

string

Default:

region

Region selection. See ”help par.region” for details. Default is to use the full image.

allowed:

any

Default:

variant

mask

Mask to use. See help par.mask. 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

Returns
image

Example

 
 
"""  
#  
print "\t----\t newimagefromimage Ex 1 \t----"  
ia.maketestimage(’test1’,overwrite=true)  
ia.maketestimage(’test2’,overwrite=true)  
print ia.name()  
#[...]test2  
im1=ia.newimagefromimage(’test1’)  
print im1.name()  
#[...]test1  
print im1.summary()  
im2=ia.newimagefromimage(’test2’)  
print im2.name()  
#[...]test2  
print im1.name()  
#[...]test1  
ia.close()  
im1.done()  
im2.done()  
#  
"""  
 
 

__________________________________________________________________


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