NRAO Home > CASA > CASA Cookbook and User Reference Manual
1.3.7.1 Variables

Python variables are set using the <parameter> = <value> syntax. Python assigns the type dynamically as you set the value, and thus you can easily give it a non-sensical value, e.g.

   vis = ’ngc5921.ms’  
   vis = 1

The CASA parameter system will check types when you run a task or tool, or more helpfully when you set inputs using inp (see below). CASA will check and protect the assignments of the global parameters in its namespace.

Note that Python variable names are case-sensitive:

CASA <109>: Foo = ’bar’  
CASA <110>: foo = ’Bar’  
CASA <111>: foo  
  Out[111]: ’Bar’  
CASA <112>: Foo  
  Out[112]: ’bar’

so be careful.

Also note that mis-spelling a variable assignment will not be noticed (as long as it is a valid Python variable name) by the interface. For example, if you wish to set correlation=’RR’ but instead type corellation=’RR’ you will find correlation unset and a new corellation variable set. Command completion (see §1.3.8.1) should help you avoid this.


More information about CASA may be found at the CASA web page

Copyright © 2010 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