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

3.2.1 put a specific table keyword


Description

Put a table keyword. The value of the keyword can be a scalar or an array of any type or it can be a record.
It is possible to define a keyword holding a subtable. In that case a special string containing the name of the subtable will be passed to the table client.
It is possible that the value of a keyword is a record itself (arbitrarily deeply nested). A field in such a subrecord can be written by separating the name with dots. If a subrecord does not exist, an error is returned unless makesubrecord=True is given. In such a case intermediate records are created when needed.

Arguments





Inputs

keyword

Name or seqnr of keyword: string or int

allowed:

any

Default:

variant

value

Value of keyword

allowed:

any

Default:

variant

makesubrecord

Create intermediate records

allowed:

bool

Default:

false

Returns
bool

Example

 
 
  tb.open("3C273XC1.MS", nomodify=False)  
  tb.putkeyword("VERSION", "1.66")  
# True  
#      define ANTENNA subtable  
  tb.putkeyword("ANTENNA", ’Table: 3C273XC1.MS/ANTENNA’)  
  tb.flush()  
# True  
#      write a field in a record and create subrecords when needed  
  tb.putkeyword("REC.SUB.FLD", "val", True)  
# True  
#      write a keyword with a record value  
  tb.putkeyword("REC", {’SUB’: {’FLD’: ’val’}})  
# True  
 
Note that the last example does the same as the previous one (assuming  
that \texttt{REC} does not exist yet with other fields).  

__________________________________________________________________


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