nraonrao
 
NRAO Home > CASA > CasaRef
table.copyrows - Function

3.2.1 copy rows from this table to another
Description

Copy rows from this table to another. By default all rows of this table are appended to the output table. It is possible though to control which rows are copied.
Rows are added to the output table as needed. Because no rows can be added to a reference table, it is only possible to overwrite existing rows in such tables.

Only the data of columns existing in both tables will be copied. Thus by making a reference table consisting of a few columns, it is possible to copy those columns only.

Arguments





Inputs

outtable

table object of output table

allowed:

string

Default:

startrowin

First row to take from input table

allowed:

int

Default:

0

startrowout

First row to write in output table, -1 (=end)

allowed:

int

Default:

-1

nrow

Nr of rows to copy, -1 (=all)

allowed:

int

Default:

-1

Returns
bool

Example

This example appends rows to the table itself, thus doubles the number of rows.

  tb.open(’3C273XC1.MS’,nomodify=False)  
  tb.copyrows(’3C273XC1.MS’)  
  tb.close()

This example copies 10 rows of the selected subset of the MS to the beginning of the output MS.

  !rm -rf in.MS out.MS  
  ms.fromfits(’in.MS’,’3C273XC1.fits’)       #Make two MSs  
  ms.fromfits(’out.MS’,’3C273XC1.fits’)      #for example  
  ms.close()  
  tb.open("in.MS")  
  t1 = tb.query(’ANTENNA1==0’)  
  tb.close()  
  t1.copyrows("out.MS",nrow=10,startrowout=0)  
  t1.close()

Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu

Copyright © 2008 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.