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

1.2.1 Give the list a name so it can save itself. use close to save to disk


Description

The rename function is used to specify the name of the table associated with this componentlist.

When a componentlist is created it is not associated with an casa table. So when the componentlist is removed from memory its contents are lost. But if a name is attached to the componentlist, using the rename function, then its contents are saved in a table with the specified name when the componentlist is closed

NOTE: that by just using rename the componentlist is not ensured to be on disk; to be sure use close after rename

If the componentlist is created using the open() constructor then this function will rename the table associated with the list to the user specified name. You cannot rename a componentlist that has been opened read only.

Arguments





Inputs

filename

The filename of the table

allowed:

string

Default:

log

Send a message to the logger

allowed:

bool

Default:

true

Returns
bool

Example

 
 
 
    cl.simulate(1);  
    cl.setshape(0, ’gaussian’, ’35mas’, ’27mas’, ’-10d’)  
    cl.setflux(0, [1.0, 0.2, 0.1, 0.01]);  
    cl.rename(’smallblob.cl’);  
    cl.close();  
 
    cl.open(’smallblob.cl’)  
    n=cl.length()  
 
    This example starts with an  empty componentlist tool and then adds  
    one component to it. The parameters of this component are then  
    modified to change the shape and flux and the list saved in the  
    casa table called ’smallblob.cl’ The data is not written to  
    disk until the list is closed, and when it is the componentlist is  
    reset. So you need to reopen it if you want to interact with it.  

__________________________________________________________________


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