Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | table |
vis:=table("3C273XC1.MS"); vis.summary(); visinx:=tableindex(vis, "ANTENNA1"); rows:=visinx.rownrs(4); rows:=visinx.rownrs(4,7);This example builds an index for column ANTENNA1. The one but last line returns the row numbers (1-relative) of all rows with value 4 for ANTENNA1. There after these row numbers can, for example be used in getcell to read data. The last line is similar, but in this case the search interval 4-7 is given. So all rows with value 4, 5, 6, or 7 in ANTENNA1 are found. An optional 3rd and 4th argument can be given to tell if the interval is open or closed (i.e. if the boundaries are part of the interval). Note that for indices on floating point numbers it is best to use a search interval, because an exact match on such numbers usually fails.
vis:=table("3C273XC1.MS"); vis.summary(); visinx:=tableindex(vis, "ANTENNA1 ANTENNA2"); rows:=visinx.rownrs([ANTENNA1=4, ANTENNA2=5); rows:=visinx.rownrs([ANTENNA1=4, ANTENNA2=5), [ANTENNA1=4, ANTENNA2=8];This example builds an index for column ANTENNA1 and ANTENNA2. Because multiple columns are used, the arguments for function rownrs have to be records now. So the one but last line returns the row numbers (1-relative) of all rows with value 4 for ANTENNA1 and 5 for ANTENNA2. The last line defines a search interval again. In this case the ordering of the columns in the index is important. It finds the rows of ANTENNA1=4 where ANTENNA2 is in the interval 5-8.
Normally a column used in a tableindex has to be a scalar column. However, if a single column is used that column can contain arrays. In such a case the rownrs function finds the rows where a value in its array matches the given search value.
If all key values in the index are unique, the function rownr can be used as well. It returns a single row number instead of a vector.
tableindex | Construct a tableindex |
close | Close the tableindex |
done | End the tableindex tool |
isunique | Are all key values in the index unique? |
rownr | Find the row number matching the search value |
rownrs | Find the row numbers matching search values |
set | Set table and columns to be indexed |
setchanged | Tell the index that columns have changed |