NRAO Home > CASA > CASA Toolkit Reference Manual
table.copy - Function

3.2.1 copy a table


Description

Copy the table. All subtables are also copied. References to another table are preserved.

The argument deep determines how a reference table (i.e. the result of a query) is copied. By default a file copy is made, thus the resulting table still contains references and no actual data. If, however, deep=True is given, a deep copy is made which means that the actual data are copied. Also all subtables are copied.
Normally a plain table is copied by copying the files. However, if deep=True and valuecopy=True are given, a plain table is copied by copying all its values and subtables. This is useful to reorganize the tables, i.e. to regain file space that is wasted by frequent updates to a table.
The argument dminfo can be used to specify explicit data manager info for the columns in the new plain table. It can be used to change, for example, a storage manager from IncrStMan to StandardStMan. The dminfo is a record as returned by the getdminfo If dminfo is a non-empty record, it forces valuecopy=True.

The standard operation is make the copy to a plain table. It is, however, possible to copy to a memory table by giving memorytable=True.

The endian format for the newly created table can be specified. This is only meaningful if a deep copy is made to a plain table. The possible values are:
- big: big endian format (as used on e.g. SUN)
- little: little endian format (as used on e.g. PC)
- local: use the endian format of the machine being used
- aipsrc: use the endian format specified in aipsrc variable table.endianformat (which defaults to big).
The default is aipsrc.

Normally the copy function only copies the table and does not create a new table tool object. The user can do that by opening the newly created table in the standard way. However, it is possible to get an object back by using returnobject=True. An object is always returned if the copy is made to a memory table.

Arguments





Inputs

newtablename

Name of newtable on disk

allowed:

string

Default:

deep

Make a deep copy of a reference table?

allowed:

bool

Default:

false

valuecopy

Make a deep copy of any table?

allowed:

bool

Default:

false

dminfo

Data manager info for new table

allowed:

record

Default:

endian

Endian format of new table

allowed:

string

Default:

aipsrc

memorytable

Hold new table in memory?

allowed:

bool

Default:

false

returnobject

Return a tool object for the new table

allowed:

bool

Default:

false

norows

Don’t copy any rows (useful for copying only the table structure)

allowed:

bool

Default:

false

Returns
table
__________________________________________________________________


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