code: def process_twi(self, index=None, do_edges=False, skip_uca_twi=False):
          
          if index is not None:
              elev_source_files = [self.elev_source_files[index]]
          else:
              elev_source_files = self.elev_source_files
          for i, esfile in enumerate(elev_source_files):
              try:
                  fn, status = self.calculate_twi(esfile,
                                                  save_path=self.save_path,
                                                  do_edges=do_edges,
                                                  skip_uca_twi=skip_uca_twi)
                  if index is None:
                      self.twi_status[i] = status
                  else:
                      self.twi_status[index] = status
              except:
                  lckfn = _get_lockfile_name(esfile)
                  try:
                      os.remove(lckfn)
                  except:
                      pass
                  traceback.print_exc()
                  print traceback.format_exc()
                  if index is None:
                      self.twi_status[i] = "Error " + traceback.format_exc()
                  else:
                      self.twi_status[index] = "Error " + traceback.format_exc()
docs: Processes the TWI, along with any dependencies (like the slope and UCA)
  
          Parameters
          -----------
          index : int/slice (optional)
              Default: None - process all tiles in source directory. Otherwise,
              will only process the index/indices of the files as listed in
              self.elev_source_files
          do_edges : bool (optional)
              Default False. When false, the UCA will be calculated with
              available edge information if the UCA was not previously computed.
              If the UCA was previously computed and do_edges == False, the UCA
              will not be updated. If do_edges == True, the UCA will also be
              recalculated.
          skip_uca_twi : bool (optional)
              Skips the calculation of the UCA and TWI (only calculates the
              magnitude and direction)
          Notes
          ------
          do_edges = False for the first round of the processing, but it is True
          for the second round.