Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | table | |
Tool | table |
If the arguments query, sortlist, and columns are empty strings (their default values), the taqlwidget will be started (if a GUI is available) before the query function is executed. In that way it is possible to let the user form the query interactively.
query | in | Query string | |
Allowed: | String | ||
Default: | '' | ||
name | in | Name of resulting reference table | |
Allowed: | String | ||
Default: | '' | ||
sortlist | in | Sort string (one or more expressions separated by commas) | |
Allowed: | String | ||
Default: | '' | ||
columns | in | List of column names separated by commas | |
Allowed: | String | ||
Default: | '' |
t:=table("3C273XC1.MS"); subt:=t.query("SPECTRAL_WINDOW_ID==1", sortlist="ARRAY_ID", columns="TIME, DATA, UVW"); print subt.ncols(); # 3 t.close(); subt.copy ("3C273XC1_spw1.MS", T); subt.close();
From the original table corresponding to the disk file 3C273XC1.MS, only rows with SPECTRAL_WINDOW_ID equal to 1 are selected and sorted by ARRAY_ID. Only the columns TIME DATA UVW are written. Thereafter a deep copy of the result is made. The table query command is equivalent to:
subt:=tablecommand(paste('select TIME, DATA, UVW from 3C273XC1.MS', 'where SPECTRAL_WINDOW_ID==1', 'orderby ARRAY_ID'))The sortlist argument can be used to sort in ascending or descending order (or a mix of them) on one or more columns. Default is ascending. It is also possible to remove duplicate values using the word NODUPLICATES at the beginning. E.g.:
sortlist='TIME desc' sortlist='noduplicates ANTENNA1,ANTENNA2' sortlist='ANTENNA1 desc, ANTENNA2 asc' sortlist='desc ANTENNA1, ANTENNA2, TIME'