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

1.1.1 Rename the image file associated with this image tool


Description

This function renames the image file associated with the image tool. If a file with name name already exists, you can overwrite it with the argument overwrite; otherwise a fail will result.

Arguments





Inputs

name

The new image file name

allowed:

string

Default:

overwrite

Overwrite target file if it already exists

allowed:

bool

Default:

false

Returns
bool

Example

 
 
"""  
Example:  
#  
print ’ ---- rename Ex 1, rename a new image ----’  
ia.maketestimage(’myimage’,overwrite=True)  
print ia.name(strippath=True)  
#myimage  
ia.rename(’newimage’, overwrite=True)  
print ia.name(strippath=True)  
#newimage  
#  
print ’ ---- rename Ex 2, rename an existing image ----’  
ia.open(’originalimage’,overwrite=True)  
ia.rename(’newimage’, overwrite=True)  
ia.close()  
#  
"""  
 

__________________________________________________________________


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