idlastro / FITS ASCII & Binary Table I/O: FTDELCOL

[Source code]

NAME
FTDELCOL
PURPOSE
Delete a column of data from a FITS table
CALLING SEQUENCE
ftdelcol, h, tab, name
INPUTS-OUPUTS
h,tab - FITS table header and data array.  H and TAB will
        be updated with the specified column deleted
INPUTS
name - Either (1) a string giving the name of the column to delete
        or (2) a scalar giving the column number to delete
EXAMPLE
Suppose it has been determined that the F7.2 format used for a field
FLUX in a FITS table is insufficient.  The old column must first be 
deleted before a new column can be written with a new format.
flux = FTGET(h,tab,'FLUX')       ;Save the existing values
FTDELCOL,h,tab,'FLUX'            ;Delete the existing column            
FTADDCOL,h,tab,'FLUX',8,'F9.2'   ;Create a new column with larger format
FTPUT,h,tab,'FLUX',0,flux        ;Put back the original values
REVISION HISTORY
Written   W. Landsman        STX Co.     August, 1988
Adapted for IDL Version 2, J. Isensee, July, 1990
Converted to IDL V5.0   W. Landsman   September 1997
pdated call to new FTINFO   W. Landsman  May 2000
On_error,2
Make sure column exists
et starting column and width (in bytes)
f a string, get the field number
Eliminate relevant columns from TAB
onvert to IDL indexing
irst column
ast column
ll other columns
Parse the header. Remove specified keyword from header. Lower
the index of subsequent keywords. Update the TBCOL*** index of
subsequent keywords
oop over each element in header
ubsequent field?
ight justify
educe number of fields by 1
educe num. of columns by WIDTH