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

1.2.1 Append components from another componentlist.


Description

The concatenate function copies the specified component(s), from the specified to list, to the end of the current list. The components are specified by numbering them from one to the length of the list. You cannot append components to a list that has been opened read only but the list you are copying from may be readonly.

You use a vector of indices to copy a number of components at once. By default all components are copied.

Arguments





Inputs

list

list to copy from. Can be a componentlist record or a componentlist file name from disk

allowed:

any

Default:

which

which components to copy, -1 unset

allowed:

intArray

Default:

-1

log

Send a message to the logger

allowed:

bool

Default:

true

Returns
bool

Example

 
 
       cl.addcomponent(flux=1.0, dir=’J2000 19h00m00 -40d00m00’)  
       cl.addcomponent(flux=2.0, dir=’J2000 19h10m00 -40d00m00’)  
       cl.addcomponent(flux=3.0, dir=’J2000 19h00m00 -40d00m00’)  
       cl2 = cltool();  
       cl2.concatenate(cl.torecord(), [0,2]);  
       cl.done()  
       cl2.rename(’part_list.cl’);  
       cl2.done()  
    We make a 3 component component list and  
    copies the first and third component to another a componentlist  
    that was initially empty. These components are then saved to the  
    table called part_list.cl.  
 
 
 
      cl.close() ### make sure we start with empty componentlist  
      cl.concatenate(’crux.cl’, [0,2]);  
      cl.rename(’crux-copy.cl’);  
      cl.done()  
 
    This example reads a componentlist from a casa table and  
    copies the first and third component to another a componentlist  
    that was initially empty. These components are then saved to the  
    table called crux-copy.cl.  
 
 

__________________________________________________________________


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