3.2.1 !!!NOT IMPLEMENTED!!! Calculate an expression on a table
Description
!!!NOT IMPLEMENTED!!!
Get the result from the calculation of an expression on a table
The expression can be any expression that can be given in the WHERE clause of a SELECT expression (thus including subqueries). The given expression determines if the result is a scalar, a vector, or a record containing arrays. See the examples below.
Arguments
| Inputs |
| ||
| expr |
| Expression string
| |
| allowed: | string |
|
| Default: |
|
|
Example
!!!NOT IMPLEMENTED!!!
tb.open("3C273XC1.MS")
tb.calc (’DATA+1’) |
returns a (potentially enormous) record where a field contains the value of the expression for the row with that number. Note that it returns a record because for each row the expression results in an array. It should be clear that this example is useless. However, something like this could be useful for a column with (very) small arrays.
tb.open("3C273XC1.MS")
tb.calc (’ntrue(FLAG)’) |
returns for each row the number of flags set. The result is a vector, because for each row the expression results in a scalar.
tb.open("3C273XC1.MS")
tb.calc (’sum([select from $1 giving [ntrue(FLAG)]])’) |
returns the total number of flags set in the table (in a single scalar). It is the same as
sum(tb.calc (’ntrue(FLAG)’))
|
The latter is easier to write, but sends (much) more data over the casapy bus.
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.