code: def sumcols(msname, col1=None, col2=None, outcol=None, cols=None, suntract=False):
      
      from pyrap.tables import table
  
      tab = table(msname, readonly=False)
      if cols:
          data = 0
          for col in cols:
              data += tab.getcol(col)
      else:
          if subtract:
              data = tab.getcol(col1) - tab.getcol(col2)
          else:
              data = tab.getcol(col1) + tab.getcol(col2)
  
  
      rowchunk = nrows//10 if nrows > 1000 else nrows
      for row0 in range(0, nrows, rowchunk):
          nr = min(rowchunk, nrows-row0)
          tab.putcol(outcol, data[row0:row0+nr], row0, nr)
  
      tab.close()
docs: add col1 to col2, or sum columns in 'cols' list.
          If subtract, subtract col2 from col1