def filter_and_copy_table(tab, to_remove):
    """ Filter and copy a FITS table.

    Parameters
    ----------
    tab :  FITS Table object 

    to_remove : [int ...}
        list of indices to remove from the table

    returns  FITS Table object
    """
    nsrcs = len(tab)
    mask = np.zeros((nsrcs), '?')
    mask[to_remove] = True
    inv_mask = np.invert(mask)
    out_tab = tab[inv_mask]
    return out_tab
Filter and copy a FITS table.

    Parameters
    ----------
    tab :  FITS Table object 

    to_remove : [int ...}
        list of indices to remove from the table

    returns  FITS Table object