Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | table | |
Tool | table |
t:=table('W53.MS') t1:=t.selectrows([1,3,5,7,9]) t1.rownumbers(t) # [1 3 5 7 9] t2:=t1.selectrows([2,5]) t2.rownumbers(t1) # [2 5] t2.rownumbers(t) # [3 9] t2.rownumbers() # [3 9]The last statements show that the function returns the row numbers referring to the given table. Table t2 contains rows 2 and 5 in table t1, which are rows 3 and 9 in table t.
Note that when a table is opened using its name, that table can
be a reference table. Thus in the example above
the last 2 statements may give different results depending on the fact
if W53.MS is a reference table or not.
The function should always be called with a table argument.
The ability of omitting the argument is only present for backward
compatibility.
The function can be useful to get the correct values from the result of a getcol or getcolslice on the original table.
tab | in | Table to which the row numbers refer | |
Allowed: | Record | ||
Default: | F | ||
nbytes | in | Maximum cache size in bytes | |
Allowed: | Int |
t:=table("W53.MS") t.nrows() # 1920 data:=t.getcolslice("Data", [1,1], [1,1]) data::shape # [1 1 1920] selt:=t.query("ANTENNA1==1") selt.nrows() # 300 subdata:=data[,,selt.rownumbers(t)] subdata::shape # [300]