GNU Astronomy Utilities


Next: , Previous: , Up: Arithmetic operators   [Contents][Index]


6.2.3.16 Loading external columns

In the Arithmetic program, you can always load new dataset by simply giving their name. However, they can only be images, not a column. In the Table program, you can load columns in Column arithmetic, but it has to be columns within the same table (and thus the same number of rows). However, in some situations, it is necessary to use certain columns of a table in the Arithmetic program, or columns of different rows (from the main input) in Table.

load-col-%-from-%
load-col-%-from-%-hdu-%

Load the requested column (first %) from the requested file (second %). If the file is a FITS file, it is also necessary to specify a HDU using the second form (where the HDU identifier is the third %. for example, load-col-MAG-from-catalog.fits-hdu-1 will load the MAG column from HDU 1 of catalog.fits.

For example, let’s assume you have the following two tables, and you would like to add the first column of the first with the second:

$ asttable tab-1.fits
1  43.23
2  21.91
3  71.28
4  18.10

$ cat tab-2.txt
5
6
7
8

$ asttable tab-1.txt -c'arith $1 load-col-1-from-tab-2.txt +'
6
8
10
12