Last modified: December 2022

AHELP for CIAO 4.15


Context: Tools::Table


Add new columns to a table.


dmpaste infile pastefile outfile [clobber] [verbose]


`dmpaste' copies infile to outfile, pasting on extra columns from the pastefile, which may be a single file or a stack of files. Column names in the pastefile cannot duplicate names in the input file. All files must have the same number of rows. Analogous to the unix `paste' command.


Example 1

dmpaste "data1.fits[EVENTS]" "data2.fits[EVENTS][cols tg_r,tg_d]"

This pastes extra columns tg_r, tg_d from data2.fits onto the columns already present in data1.fits, making a new file data3.fits.

Example 2

dmpaste "data1.fits[EVENTS]" data2.fits data3.fits

This pastes all the columns from data2.fits onto the data1.fits table.

Example 3

dmpaste "data1.fits[EVENTS][cols -pha]" "data2.fits[EVENTS][cols pha]"

Replace the pha column in data1.fits by the one in data2.fits.


name type ftype def min max reqd
infile file input       yes
pastefile file input       yes
outfile file output       yes
clobber boolean   no      
verbose integer   0 0 5  

Detailed Parameter Descriptions

Parameter=infile (file required filetype=input)

Input file name

The input file used as the basis for the new file. The output file will contain all columns from the input file and the header from the input file.

Parameter=pastefile (file required filetype=input)

Input paste file list

All the columns in pastefile will be pasted on to infile. If pastefile is a stack, the columns from all the files in the stack will be used.

Parameter=outfile (file required filetype=output)

output file name.

The output file containing a version of infile with the extra columns appended.

Parameter=clobber (boolean default=no)

Clobber exisiting files?

Used to specify whether to clobber output file if it already exists.

Parameter=verbose (integer default=0 min=0 max=5)

Amount of diagnostic chatter, 0 (least) to 5 (most).


dmpaste does not handle all vector columns correctly.  (07 Mar 2008)

The tool gets the range for the first component of the vector column (e.g. chipx=1:4096). When creating the output file, it uses this value for the entire chip column range instead of setting the range for each component of the vector separately. Since the chipy range is very different from the chipx range, subsequent filtering selects no events in the range for any filter.

See Also

dmfiltering, dmopt
dmappend, dmgroup, dmgti, dmjoin, dmmerge, dmpaste, dmsort, dmtabfilt, dmtcalc, dmtype2split