code: def filter_and_copy_table(tab, to_remove):
      
      nsrcs = len(tab)
      mask = np.zeros((nsrcs), '?')
      mask[to_remove] = True
      inv_mask = np.invert(mask)
      out_tab = tab[inv_mask]
      return out_tab
docs: 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